我正在尝试将URL中的图像加载到ImageView
使用Picasso中.
共享转换的图像位于a CardView
中RecyclerView
,而第二个图像位于LinearLayout中.第一次发出请求时,元素没有动画,因为毕加索需要将图像加载到视图中,但是在后续请求中它很好.
如何ImageView
在启动转换之前确保已成功填充?
我正在为导航构建一个基本活动,并且想要一些灵活的东西,因此Activity指示Base Activity要扩展哪个布局.
我有以下内容
public abstract class BaseActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {
private int mLayoutRes;
protected void setLayout(int layoutRes) {
mLayoutRes = layoutRes;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(mLayoutRes);
// Layout implements toolbar
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
if (toolbar != null){
setSupportActionBar(toolbar);
}
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
// The layout implements the nav
if (drawer != null){
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.setDrawerListener(toggle);
toggle.syncState();
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this); …
Run Code Online (Sandbox Code Playgroud)