Skip to content

Commit

Permalink
new commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kenmeidearu committed Nov 17, 2017
1 parent 081f27d commit 8ee7e8b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 33 deletions.
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.github.kenmeidearu:SearchableSpinner:1.5.4-8'
compile 'com.github.kenmeidearu:SearchableSpinner:1.5.4-9'
//compile project(':searchablespinnerlibrary')
//compile project(path: ':searchablespinnerlibrary', configuration: 'default')
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import android.annotation.SuppressLint;
import android.content.Context;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -94,40 +92,39 @@ public View getView(int position, View convertView, ViewGroup parent) {
}
holder = new ViewHolder();
v.setTag(holder);
}else{
holder = (ViewHolder) v.getTag();
}

if (type == 0) {
holder.images=(ImageView)v.findViewById(R.id.images);
holder.nilai1 = (TextView) v.findViewById(R.id.spinnerHead);
holder.nilai2 = (TextView) v.findViewById(R.id.sub);
} else if (type == 1) {
holder.nilai1 = (TextView) v.findViewById(R.id.spinnerHead);
} else if (type == 2) {
holder.nilai1 = (TextView) v.findViewById(R.id.spinnerHead);
holder.nilai2 = (TextView) v.findViewById(R.id.sub);
} else if (type == 3) {
holder.nilai1 = (TextView) v.findViewById(R.id.spinnerHead);
holder.nilai2 = (TextView) v.findViewById(R.id.sub);
holder.nilai3 = (TextView) v.findViewById(R.id.sideHead);
} else if (type == 4) {
holder.nilai1 = (TextView) v.findViewById(R.id.spinnerHead);
holder.nilai2 = (TextView) v.findViewById(R.id.sub);
holder.nilai3 = (TextView) v.findViewById(R.id.sideHead);
holder.nilai4 = (TextView) v.findViewById(R.id.sideSub);
} else {
holder.nilai1 = (TextView) v.findViewById(R.id.spinnerHead);
holder = (ViewHolder) v.getTag();
}

mListString p = getItem(position);
if (p != null) {
String val1, val2, val3, val4,valImage;
if (type == 0) {
holder.images = (ImageView) v.findViewById(R.id.images);
holder.nilai1 = (TextView) v.findViewById(R.id.spinnerHead);
holder.nilai2 = (TextView) v.findViewById(R.id.sub);
} else if (type == 1) {
holder.nilai1 = (TextView) v.findViewById(R.id.spinnerHead);
} else if (type == 2) {
holder.nilai1 = (TextView) v.findViewById(R.id.spinnerHead);
holder.nilai2 = (TextView) v.findViewById(R.id.sub);
} else if (type == 3) {
holder.nilai1 = (TextView) v.findViewById(R.id.spinnerHead);
holder.nilai2 = (TextView) v.findViewById(R.id.sub);
holder.nilai3 = (TextView) v.findViewById(R.id.sideHead);
} else if (type == 4) {
holder.nilai1 = (TextView) v.findViewById(R.id.spinnerHead);
holder.nilai2 = (TextView) v.findViewById(R.id.sub);
holder.nilai3 = (TextView) v.findViewById(R.id.sideHead);
holder.nilai4 = (TextView) v.findViewById(R.id.sideSub);
} else {
holder.nilai1 = (TextView) v.findViewById(R.id.spinnerHead);
}

String val1, val2, val3, val4, valImage;
val1 = p.getNilai1();
val2 = p.getNilai2();
val3 = p.getNilai3();
val4 = p.getNilai4();
valImage=p.getImageName();
valImage = p.getImageName();

if (holder.nilai1 != null) {
holder.nilai1.setText(val1);
Expand All @@ -141,7 +138,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
if (holder.nilai4 != null) {
holder.nilai4.setText(val4);
}
if(holder.images!=null){
if (holder.images != null) {

Picasso.with(mContext).setLoggingEnabled(true);
Picasso.with(mContext)
Expand All @@ -159,7 +156,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
.placeholder(R.drawable.noimage)
.error(R.drawable.noimage)
.into(holder.images);*/
Log.e("isi image",val1 +" image:"+valImage);
// Log.e("isi image",val1 +" image:"+valImage);
}
}

Expand All @@ -169,7 +166,7 @@ public View getView(int position, View convertView, ViewGroup parent) {

public class ViewHolder {
public TextView nilai1, nilai2 = null, nilai3 = null, nilai4 = null;
public ImageView images=null;
public ImageView images = null;
}

// Filter Class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,4 @@
android:text="detail"
android:textSize="14sp" />
</LinearLayout>

</LinearLayout>

0 comments on commit 8ee7e8b

Please sign in to comment.