I want to load an URL into an imageView located in a different layout than the current activity layout.
I don't know what's this com.rey.material package and where it comes from. I assume maybe it is used by the template i've been importing. Do you have an idea on how to fix this problem ?
theListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, final View view, final int pos, long l) {
// Unfold cell first then Change Stuff inside
// toggle clicked cell state
((FoldingCell) view).toggle(false);
// register in adapter that state for selected cell is toggled
adapter.registerToggle(pos);
final LayoutInflater factory = getLayoutInflater();
final View cell = factory.inflate(R.layout.cell, null);
ImageView image = (ImageView) cell.findViewById(R.id.head_image);
Picasso.get().load("http://i.imgur.com/DvpvklR.png").into(image);
}
});
This is the layout that wraps everything together :
<com.ramotion.foldingcell.FoldingCell xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:folding-cell="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
folding-cell:additionalFlipsCount="2"
folding-cell:animationDuration="1300"
folding-cell:backSideColor="@color/bgBackSideColor"
folding-cell:cameraHeight="30">
<!-- CONTENT (UNFOLDED) LAYOUT (MUST BE AT LEAST 2x times BIGGER than content layout bellow)-->
<include layout="@layout/cell_content_layout" />
<!-- TITLE (FOLDED) LAYOUT (MUST BE AT LEAST 2x times SMALLER than content layout above) -->
<include layout="@layout/cell_title_layout" />
</com.ramotion.foldingcell.FoldingCell>
And this is the layout containing the specific imageView :
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/head_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:src="@drawable/head_image" />
</RelativeLayout>
</LinearLayout>
Never mind, it was a misclick on my part:
When importing packages for ImageView
, I clicked the first package instead of the usual one, which caused this problem. Solution:
Replace
import com.rey.material.widget.ImageView
with
import android.widget.ImageView