android View.Onclick doesn't fire - android

the issue is whithin 3 imageviews don't display toast and also i tried to log any text whithin its onlick and from anonymous also not working any suggestion?
Screenshot
My XML
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#mipmap/bg_login"
android:orientation="vertical"
android:paddingBottom="19dp"
android:paddingLeft="10dp"
android:paddingRight="9dp"
tools:context="com.example.mahmoud.blink.LoginFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="217dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="51dp"></LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="5">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"></LinearLayout>
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="3"
android:src="#mipmap/logo_small" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"></LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="#mipmap/overlay_white"
android:clickable="false"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp">
<ImageView
android:id="#+id/iv_tm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:clickable="true"
app:srcCompat="#mipmap/t" />
<ImageView
android:id="#+id/iv_fbm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginEnd="31dp"
android:layout_marginRight="31dp"
android:layout_toLeftOf="#+id/iv_tm"
android:layout_toStartOf="#+id/iv_tm"
android:background="#mipmap/f"
android:clickable="true" />
<ImageView
android:id="#+id/iv_googlem"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="31dp"
android:layout_marginStart="31dp"
android:layout_toEndOf="#+id/iv_tm"
android:layout_toRightOf="#+id/iv_tm"
android:clickable="true"
app:srcCompat="#mipmap/g" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
android:id="#+id/txtEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10.5dp"
android:layout_marginRight="12dp"
android:drawableLeft="#mipmap/mail2"
android:drawablePadding="10dp"
android:hint="Email"
android:inputType="textEmailAddress" />
<EditText
android:id="#+id/txtPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10.5dp"
android:layout_marginRight="12dp"
android:drawableLeft="#mipmap/password"
android:drawablePadding="10dp"
android:ems="10"
android:hint="Password"
android:inputType="textPassword" />
</LinearLayout>
<com.wang.avi.AVLoadingIndicatorView
android:id="#+id/avi"
style="#style/AVLoadingIndicatorView.Large"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center_vertical|center_horizontal"
app:indicatorColor="#color/colorPrimary"
app:indicatorName="BallClipRotatePulseIndicator" />
</FrameLayout>
<Button
android:id="#+id/btn_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="15dp"
android:background="#mipmap/normal_btn"
android:text="Sign In"
android:textColor="#8b572a" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:layout_marginRight="4dp"
android:layout_weight="1"
android:orientation="horizontal">
<Button
android:id="#+id/btn_forget_pass"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#mipmap/sencondry_btn"
android:text="Forgot Password"
android:textColor="#fff" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginRight="6dp"
android:layout_weight="1"
android:orientation="horizontal">
<Button
android:id="#+id/btn_signup"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#mipmap/sencondry_btn"
android:text="Sign up"
android:textColor="#fff" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Java Code
in LoginFragment.java
//decleration within the fragment class
ImageView iv_g;
ImageView iv_fb;
ImageView iv_t;
From onCreateView method
View view = inflater.inflate(R.layout.fragment_login, container, false);
iv_fb = (ImageView) view.findViewById(R.id.iv_fbm);
iv_t = (ImageView) view.findViewById(R.id.iv_tm);
iv_g = (ImageView) view.findViewById(R.id.iv_googlem);
iv_fb.setOnClickListener(this);
iv_g.setOnClickListener(this);
iv_t.setOnClickListener(this);
From onClick method
if (v.getId() == R.id.iv_googlem) {
Toast.makeText(context, "google", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(context, MyService.class);
intent.putExtra("type", "google");
context.startService(intent);
} else if (v.getId() == R.id.iv_fbm) {
Toast.makeText(context, "facebook", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(context, MyService.class);
intent.putExtra("type", "facebook");
context.startService(intent);
} else if (v.getId() == R.id.iv_tm) {
Toast.makeText(context, "twitter", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(context, MyService.class);
intent.putExtra("type", "twitter");
context.startService(intent);
}
the 3 buttons works right , but the 3 ImageViews don't triggerd when clicked

Try this syntax and see if it works :
iv_fb.setOnClickListener(new view.OnClickListener{ public void onClick()
{
Toast.makeText(context, "google", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(context, MyService.class);
intent.putExtra("type", "google");
context.startService(intent);
} });

Related

How to click button inside listview

I know this problem already asked many times but i still can't get effective way for solving this. I try for use ListView with clickable/editable widget and Android : How to set onClick event for Button in List item of ListView as reference but the result is i need click button several time for executing my program. Here my program
LeadActivity.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".LeadSalesActivity">
<LinearLayout
android:background="#E9ECEB"
android:layout_margin="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/b_menusamping2"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_margin="20dp"
android:background="#drawable/menu_button"
android:backgroundTint="#27D01B"/>
</LinearLayout>
<LinearLayout
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Welcome,"
android:textSize="20sp"
android:textStyle="italic"
android:textColor="#android:color/black"/>
<TextView
android:id="#+id/t_username3"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="Rizaldi"
android:textColor="#android:color/black"
android:textSize="25sp"
android:textStyle="bold"
android:fontFamily="#font/action_man_bold"/>
</LinearLayout>
<LinearLayout
android:id="#+id/linear_refresh2"
android:layout_margin="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#android:color/white">
<ImageView
android:backgroundTint="#27D01B"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_margin="10dp"
android:background="#drawable/icon_update"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_marginLeft="20dp"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Lead"
android:textColor="#android:color/black"
android:textSize="20sp"/>
<TextView
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="("
android:textSize="20sp"
android:textColor="#android:color/black"/>
<TextView
android:textStyle="bold"
android:id="#+id/count_lead"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="100"
android:textColor="#android:color/black"
android:textSize="20sp"/>
<TextView
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text=")"
android:textSize="20sp"
android:textColor="#android:color/black"/>
<Button
android:id="#+id/btn_add"
android:layout_marginRight="20dp"
android:backgroundTint="#android:color/holo_blue_light"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Tambah Lead"
android:textAllCaps="false"/>
</LinearLayout>
<LinearLayout
android:padding="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Tanggal"
android:textColor="#android:color/black"
android:textSize="20sp"/>
<TextView
android:layout_marginLeft="30dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Lead"
android:textSize="20sp"
android:textColor="#android:color/black"/>
<TextView
android:layout_marginLeft="40dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Telp"
android:textColor="#android:color/black"
android:textSize="20sp"/>
</LinearLayout>
<ListView
android:id="#+id/listviewlead"
tools:listitem="#layout/c_lead"
android:layout_width="match_parent"
android:layout_height="400dp"
android:layout_weight="1" />
</LinearLayout>
</ScrollView>
</LinearLayout>
<LinearLayout
android:layout_marginTop="30dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<Button
android:id="#+id/back6"
android:layout_marginRight="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="back"/>
</LinearLayout>
c_lead.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/t_tgl"
android:focusable="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
android:text="Tgl"
android:textSize="15sp"
android:textStyle="italic"
android:textColor="#000000" />
<TextView
android:id="#+id/t_lead4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
android:text="Lead"
android:textSize="15sp"
android:textColor="#000000" />
<TextView
android:id="#+id/t_numberphone"
android:focusable="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
android:gravity="right"
android:text="No.Telp"
android:textSize="15sp"
android:textColor="#android:color/black"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<LinearLayout
android:id="#+id/btn_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="#drawable/kotak_abu"
android:layout_marginTop="5dp">
<ImageButton
android:layout_margin="10dp"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="#drawable/pencil_icon"/>
</LinearLayout>
<LinearLayout
android:id="#+id/btn_delete"
android:layout_marginLeft="3dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="#drawable/kotak_abu"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp">
<ImageButton
android:layout_margin="10dp"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="#drawable/delete_icon"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/t_alamat"
android:focusable="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
android:text="Alamat"
android:textColor="#android:color/black"
android:textSize="15sp"
android:layout_marginLeft="20dp"/>
</LinearLayout>
MyAdapter
public View getView(final int _position, View _v, ViewGroup _container) {
LayoutInflater _inflater = (LayoutInflater)getBaseContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View _view = _v;
if (_view == null) {
_view = _inflater.inflate(R.layout.c_lead, null);
}
final HashMap<String, Object> hashMap = _data.get(_position);
final TextView t_tanggal = (TextView) _view.findViewById(R.id.t_tgl);
final TextView t_lead = (TextView) _view.findViewById(R.id.t_lead4);
final TextView t_alamat = (TextView) _view.findViewById(R.id.t_alamat);
final TextView t_numberphone = (TextView) _view.findViewById(R.id.t_numberphone);
final LinearLayout btn_edit = (LinearLayout) _view.findViewById(R.id.btn_edit);
final LinearLayout btn_delete = (LinearLayout) _view.findViewById(R.id.btn_delete);
String dateString = _data.get(_position).get("create_date").toString().replace("-","");
SimpleDateFormat format1 = new SimpleDateFormat("yyyyMMddHHmm");
format1.setTimeZone(TimeZone.getTimeZone("GMT+7"));
SimpleDateFormat format2 = new SimpleDateFormat("dd-MM-yyyy");
try {
Date date = format1.parse(dateString);
String dateFinal = format2.format(date);
t_tanggal.setText(String.valueOf((long)(_position + 1)).concat(".").concat(dateFinal));
} catch (ParseException e) {
e.printStackTrace();
}
t_lead.setText(_data.get((int)_position).get("type").toString());
t_alamat.setText(_data.get((int)_position).get("street").toString());
if (_data.get((int)_position).get("mobile").toString().equals(true)){
t_numberphone.setText("Tanpa Nomor");
} else {
t_numberphone.setText(_data.get((int)_position).get("phone").toString());
}
btn_edit.setFocusable(false);
btn_edit.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
i.setClass(getApplicationContext(), AddLeadSalesActivity.class);
startActivity(i);
}
});
btn_delete.setFocusable(false);
btn_delete.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Toast.makeText(getApplicationContext(), "Data Tidak Bisa Dihapus", Toast.LENGTH_SHORT).show();
}
});
return _view;
}
Is there any mistake inside my program? How to solve this?

Layout not showing up when using intent to start new activity

I have a fragment class with 6 hard-coded cardviews. I want the user to be able to click on them and it open up another activity. Each opens to different activity. Currently, when the user clicks on the cardview it opens the new activity, but doesn't show the layout. For example, when the user clicks on the science cardview it just shows a blank page, but doesn't show the layout with the button.
Here is my fragment page code:
public class show_class extends Fragment implements
View.OnClickListener {
private CardView science_cv, math_cv, social_studies_cv, english_cv,
tech_cv, other_cv;
private DatabaseReference myRef ;
//List<show_class> list;
// private RecyclerView recycle;
// Button view;
public show_class() {
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.activity_show_class, container, false);
//find cardview's by ids
science_cv = (CardView) view.findViewById(R.id.science);
math_cv = (CardView) view.findViewById(R.id.math);
social_studies_cv = (CardView) view.findViewById(R.id.social_studies);
english_cv = (CardView) view.findViewById(R.id.English);
tech_cv = (CardView) view.findViewById(R.id.tech);
other_cv= (CardView) view.findViewById(R.id.other);
//set onclicklistener to cardviews
science_cv.setOnClickListener(this);
social_studies_cv.setOnClickListener(this);
math_cv.setOnClickListener(this);
english_cv.setOnClickListener(this);
tech_cv.setOnClickListener(this);
other_cv.setOnClickListener(this);
return view;
}
public void onClick (View v){
Intent i;
switch (v.getId()) {
case R.id.science:
i = new Intent(getContext(), Science_classes.class);
case R.id.math: i = new Intent(getContext(), Math_classes.class);startActivity(i);break;
case R.id.social_studies: i = new Intent(getContext(), Social_studies_classes.class);startActivity(i);break;
case R.id.English: i = new Intent(getContext(), English_classes.class);startActivity(i);break;
case R.id.tech: i = new Intent(getContext(), Technology_classes.class);startActivity(i);break;
case R.id.other: i = new Intent(getContext(), Other_classes.class);startActivity(i);break;
default:break;
}
}
}
Here is my xml for the fragment page:
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#a4a4a4">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:clipToPadding="false"
android:gravity="center"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:clickable="true"
android:focusable="true"
android:foreground="?android:selectableItemBackground"
android:id="#+id/science"
android:layout_width="160dp"
android:layout_height="190dp"
android:layout_margin="10dp"
android:padding="0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="130dp"
android:gravity="center"
android:background="#color/colorSecondary">
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:src="#drawable/ic_launcher_background"
android:padding="10dp"/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Science"
android:textColor="#000"
android:textSize="18dp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/lightgray"
android:layout_margin="2dp"/>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:onClick="show2"
android:foreground="?android:attr/selectableItemBackground"
android:clickable="true"
android:id="#+id/math"
android:layout_width="160dp"
android:layout_height="190dp"
android:layout_margin="10dp"
android:padding="0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="130dp"
android:gravity="center"
android:background="#color/colorSecondary">
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:padding="10dp"
android:src="#drawable/ic_launcher_background" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Math"
android:textColor="#000"
android:textSize="18dp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/lightgray"
android:layout_margin="2dp"/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<LinearLayout
android:clipToPadding="false"
android:gravity="center"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:onClick="show3"
android:foreground="?android:attr/selectableItemBackground"
android:clickable="true"
android:id="#+id/English"
android:layout_width="160dp"
android:layout_height="190dp"
android:layout_margin="10dp"
android:padding="0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="130dp"
android:gravity="center"
android:background="#color/colorSecondary">
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:padding="10dp"
android:src="#drawable/ic_launcher_background" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="English"
android:textColor="#000"
android:textSize="18dp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/lightgray"
android:layout_margin="2dp"/>
/>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:onClick="show4"
android:foreground="?android:attr/selectableItemBackground"
android:clickable="true"
android:id="#+id/social_studies"
android:layout_width="160dp"
android:layout_height="190dp"
android:layout_margin="10dp"
android:padding="0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="130dp"
android:gravity="center"
android:background="#color/colorSecondary">
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:padding="10dp"
android:src="#drawable/ic_launcher_background" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Social Studies"
android:textColor="#000"
android:textSize="18dp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/lightgray"
android:layout_margin="2dp"/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<LinearLayout
android:clipToPadding="false"
android:gravity="center"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:onClick="show5"
android:foreground="?android:attr/selectableItemBackground"
android:clickable="true"
android:id="#+id/tech"
android:layout_width="160dp"
android:layout_height="190dp"
android:layout_margin="10dp"
android:padding="0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:background="#color/colorSecondary"
android:layout_width="match_parent"
android:layout_height="130dp"
android:gravity="center"
>
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:src="#drawable/ic_launcher_background"
android:padding="10dp"/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Technology"
android:textColor="#000"
android:textSize="18dp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/lightgray"
android:layout_margin="2dp"/>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:onClick="show6"
android:foreground="?android:attr/selectableItemBackground"
android:clickable="true"
android:id="#+id/other"
android:layout_width="160dp"
android:layout_height="190dp"
android:layout_margin="10dp"
android:padding="0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="130dp"
android:gravity="center"
android:background="#color/colorSecondary">
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:padding="10dp"
android:src="#drawable/ic_launcher_background" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Other"
android:textColor="#000"
android:textSize="18dp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/lightgray"
android:layout_margin="2dp"/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</LinearLayout>
</ScrollView></FrameLayout>
Here is the code for the science class i am trying to go to(it is the same for all):
public class Science_classes extends AppCompatActivity {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_science_classes);
}
}
Here is the xml, just a simple button:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Science_classes">
<Button
android:id="#+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Button" />
there is a missing startActivity(i); and break; statement in the first case case R.id.science: that is the reason that after clicking science you are ending up with maths case and starting a maths activity. Will have to check if that is the problem of the blank screen. Is you maths activity layout empty?
'in your show_class fragment in onClick() you are not starting the Science_classes activity like.'
'in first case of R.id.science'
startActivity(i);

Clicking on navigation drawer listview item opens unclicked activity every time

I'm implementing a service and receiver in SettingsActivity and when i open the app for the first time there is no issue but once I visit SettingsActivity and come back, closing the navigation drawer from then on opens SettingsActivity everytime even if don't click any item in the listview
This is my MainActivity layout file where i have implemented navigation drawer :-
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:orientation="vertical"
android:fitsSystemWindows="true"
android:id="#+id/drawer_layout">
<FrameLayout
android:id="#+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false"
android:orientation="vertical">
<LinearLayout
android:id="#+id/top_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.3"
android:background="#00AFF0"
android:orientation="vertical">
<TextView
android:id="#+id/ship_name"
android:layout_width="wrap_content"
android:minWidth="120dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:gravity="center"
android:textColor="#00AFF0"
android:background="#drawable/button_background"
android:padding="10dp"
android:textSize="16sp"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center"
android:gravity="center"
android:layout_marginTop="10dp">
<ImageButton
android:id="#+id/date_reset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_action_reset"
android:background="#android:color/transparent"
android:layout_marginEnd="10dp"
android:visibility="gone"/>
<TextView
android:id="#+id/current_date"
android:layout_width="wrap_content"
android:minWidth="120dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:gravity="center"
android:textColor="#android:color/white"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:textSize="16sp"
/>
<ImageButton
android:id="#+id/date_select"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_action_date"
android:background="#android:color/transparent"
android:layout_marginStart="10dp"/>
</LinearLayout>
<LinearLayout
android:id="#+id/tickets_layout"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="10dp"
android:layout_gravity="center"
android:layout_marginEnd="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginStart="20dp"
android:background="#drawable/button_border"
android:gravity="center"
android:minWidth="120dp"
android:orientation="horizontal"
android:textColor="#android:color/white">
<TextView
android:id="#+id/ticket_no_count"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:gravity="end|center"
android:padding="2dp"
android:text=""
android:textColor="#FFFF00"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:padding="2dp"
android:gravity="center_vertical"
android:text="#string/tickets"
android:textAllCaps="true"
android:textColor="#android:color/white"
android:textSize="16sp" />
<View
android:layout_width="2dp"
android:layout_height="match_parent"
android:background="#android:color/white" />
<TextView
android:id="#+id/no_of_people_count"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:gravity="end|center"
android:padding="2dp"
android:textSize="16sp"
android:textColor="#FFFF00" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:padding="2dp"
android:text="#string/people"
android:textSize="16sp"
android:textAllCaps="true"
android:gravity="center_vertical"
android:textColor="#android:color/white" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/txt_no_data"
android:gravity="center|center_horizontal"
android:textSize="18sp"
android:textColor="#color/textColor"
android:textStyle="bold"
android:visibility="gone"
android:paddingTop="15dp"
/>
</LinearLayout>
<LinearLayout
android:id="#+id/search_layout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.2"
android:orientation="vertical"
android:layout_gravity="center">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<EditText
android:id="#+id/ticket_no"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_weight="0.8"
android:layout_marginStart="20dp"
android:layout_marginRight="5dp"
android:layout_marginEnd="5dp"
android:background="#drawable/edittextbackground"
android:imeOptions="actionDone"
android:paddingStart="10dp"
android:paddingEnd="0dp"
android:maxLength="19"
android:inputType="number"
android:digits="01234 56789"
android:maxLines="1"
/>
<Button
android:id="#+id/search_ticket_button"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginEnd="20dp"
android:layout_weight="0.2"
android:textColor="#android:color/white"
android:text="#string/go"
android:textSize="16sp"
android:textAllCaps="true"
android:background="#drawable/go_button_shape"/>
</LinearLayout>
<LinearLayout
android:id="#+id/or_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="30dp"
android:orientation="horizontal"
android:paddingRight="30dp">
<View
android:layout_width="0dp"
android:layout_height="2dp"
android:layout_weight="0.4"
android:layout_gravity="center_vertical"
android:background="#android:color/black"
/>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.1"
android:text="#string/or"
android:textSize="20sp"
android:gravity="center"/>
<View
android:layout_width="0dp"
android:layout_height="2dp"
android:layout_weight="0.4"
android:layout_gravity="center_vertical"
android:background="#android:color/black"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/scan_layout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="vertical"
android:layout_weight="0.5">
<Button
android:id="#+id/scanQr"
android:layout_width="wrap_content"
android:minWidth="120dp"
android:layout_height="40dp"
android:text="#string/scan_qr"
android:layout_gravity="center|top"
android:gravity="center"
android:textColor="#android:color/white"
android:background="#drawable/scan_button"
android:padding="10dp"
android:layout_marginTop="10dp"
android:textSize="16sp"
/>
<me.dm7.barcodescanner.zxing.ZXingScannerView
android:id="#+id/scanner"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"/>
<TextView
android:id="#+id/scan_results"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginTop="50dp"
android:layout_marginBottom="10dp"
android:visibility="visible"
android:textStyle="bold"
android:textSize="18sp"
android:gravity="left"
android:layout_marginStart="20dp"
android:layout_marginRight="5dp"
android:layout_marginEnd="5dp"
android:paddingStart="10dp"
android:paddingEnd="0dp"
/>
</LinearLayout>
<TextView
android:id="#+id/no_trips_tv"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.5"
android:layout_gravity="center"
android:gravity="center"
android:textColor="#android:color/darker_gray"
android:textSize="18sp"
android:text="#string/no_trips"
android:visibility="gone"/>
</LinearLayout>
</FrameLayout>
<FrameLayout
android:id="#+id/layout_layer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/transparent"
android:alpha="0.5"
/>
<ListView
android:id="#+id/drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#FFF"
android:choiceMode="singleChoice"
/>
</android.support.v4.widget.DrawerLayout>
And in my MainActivity i handle item click events like this where navList is Listview and drawer is DrawerLayout :-
navList.setOnItemClickListener(new AdapterView.OnItemClickListener(){
#Override
public void onItemClick(AdapterView<?> parent, View view, final int position, long id){
drawer.setDrawerListener( new DrawerLayout.SimpleDrawerListener(){
#Override
public void onDrawerClosed(View drawerView){
super.onDrawerClosed(drawerView);
if (position == 0){
} else if(position == 1)
{
getTicketsInfo(Helper.getValueFromSharedPreferences("shipId",getApplicationContext()),currentDate);
} else if(position == 2) {
submitTickets();
} else if(position == 3) {
Intent settingsIntent = new Intent(MainActivity.this, SettingsActivity.class);
startActivity(settingsIntent);
} else {
Helper.removeKeyStoredinSharedPreferences("sessionHandle", getApplicationContext());
finish();
}
}
});
drawer.closeDrawer(navList);
}
});
remove drawer.setDrawerListener and place the code directly inside onItemClick
drawerList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
#Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
switch(position)
{
case:0
{
break;
}
case:1
{
getTicketsInfo(Helper.getValueFromSharedPreferences("shipId",getApplicationContext()),currentDate);
break;
}
case:2
{
submitTickets();
break;
}
case:3
{
Intent settingsIntent = new Intent(MainActivity.this, SettingsActivity.class);
startActivity(settingsIntent);
break;
}
case:4{
Helper.removeKeyStoredinSharedPreferences("sessionHandle", getApplicationContext());
finish();
break;
}
default:
}
}
});
drawer.closeDrawer(navList);
}

Button inside cardview does not work

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:padding="10dp"
android:paddingTop="8dp"
android:descendantFocusability="blocksDescendants">
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="#+id/card_view"
android:layout_gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
card_view:cardCornerRadius="2dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:id="#+id/view"
android:layout_width="5dp"
android:layout_height="match_parent"
android:background="#color/accent"/>
<TextView
android:id="#+id/m_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#FF6600"
android:textSize="30dp"
android:layout_toRightOf="#id/view"
android:text="hey th"
android:textStyle="bold" />
<Button
android:id="#+id/m_delete"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_toRightOf="#id/m_name"
android:layout_weight="0"
android:text="Delete" />
</RelativeLayout>
</android.support.v7.widget.CardView>
I have put a button inside like this and this is shown in recycler view.
The problem I am facing is that the button click only works if I long press on the button else if i click normally then intent is called.
holder.delete.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
MetricsDAO dao = new MetricsDAO(context);
dao.deleteMetrics(metrices.get(position).getEventName());
dao.close();
Intent i = new Intent(context, HealthGraph.class);
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
// ((Activity) context).finish();
}
});
I am doing this inside on onBindViewHolder()..
What is it that i am doing wrong or missing?

What's the difference between listview item and listview footer in rendering life cycle?

I have a listview contains items and footer views. Items layout works as it should, but footer's layout doesn't work like item views...
I could't understand where my fault is.
This is my item's layout xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/lstCardItem"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:background="#drawable/pm_dashboard_cardshadow" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5.33dp"
android:layout_marginLeft="11.67dp"
android:layout_marginRight="11.67dp"
android:layout_marginTop="6dp" >
<ImageView
android:id="#+id/ivCard"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:animateLayoutChanges="true"
android:scaleType="fitXY" />
<com.controls.DynamicResizeImageView
android:id="#+id/ivCardLock"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
android:background="#drawable/pm_dashboard_cardmask"
android:scaleType="center"
android:src="#drawable/selector_btn_dashboard_lock" />
<LinearLayout
android:id="#+id/llInfo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:gravity="top|right"
android:orientation="vertical"
android:paddingLeft="18dp"
android:paddingRight="18dp"
android:visibility="visible" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center|right"
android:gravity="center|right"
android:orientation="horizontal"
android:paddingBottom="4dp"
android:paddingTop="4dp" >
<TextView
android:id="#+id/tvCardBalance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="#+id/tvCurrency"
android:gravity="top"
android:text="10,344"
android:textColor="#color/white"
android:textSize="18dp"
android:typeface="serif" />
<TextView
android:id="#+id/tvCurrency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="3dp"
android:layout_marginTop="2dp"
android:gravity="top"
android:text="#string/global_currency"
android:textColor="#color/white"
android:textSize="10dp"
android:typeface="sans" />
<TextView
android:id="#+id/tvCardBalanceName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:text="#string/pgDashboard_lblBalanceBanner"
android:textColor="#color/white"
android:textSize="11.33dp"
android:typeface="monospace" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/pm_dashboard_seam" />
</LinearLayout>
For my businness side lifecycle:
private void refreshCards() {
if (applyButtons != null)
DashboardFragment.this.lvCards.removeFooterView(applyButtons);
applyButtons = new LinearLayout(getActivity());
applyButtons.setTag("FOOTER");
applyButtons.setOrientation(LinearLayout.VERTICAL);
AbsListView.LayoutParams LLParams = new AbsListView.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
applyButtons.setLayoutParams(LLParams);
if (ininalCount < 32) {
View createNewCardButton = getApplyButtonView(R.string.pgDashboard_lblCreateIninalCard, R.drawable.pm_dashboard_card_yenikartolustur, R.drawable.pm_dashboard_arrow_icon, new View.OnClickListener() {
#Override
public void onClick(View v) {
Intent intent = new Intent(getActivity(), CreateNewCardActivity.class);
startActivity(intent);
}
});
View AddCard = getApplyButtonView(R.string.pgDashboard_lblAddCard, R.drawable.pm_dashboard_card_yenikartekle, R.drawable.pm_dashboard_plus_icon, new View.OnClickListener() {
#Override
public void onClick(View v) {
Intent intent = new Intent(getActivity(), AddCardActivity.class);
startActivity(intent);
}
});
applyButtons.addView(createNewCardButton);
applyButtons.addView(AddCard);
}
final View applyIngCard = getApplyButtonView(R.string.pgDashboard_lblApplyToIngCard, R.drawable.pm_dashboard_card_orange, R.drawable.pm_dashboard_arrow_icon, new View.OnClickListener() {
#Override
public void onClick(View v) {
CardApplicationActivity.Synchronizer.synchronize((BaseActivity) getActivity(), new OnSyncCompletedListener() {
#Override
public void onSyncCompleted() {
Intent intent = new Intent(getActivity(), CardApplicationActivity.class);
startActivity(intent);
}
});
}
});
applyButtons.addView(applyIngCard);
View view = new View(getActivity());
view.setLayoutParams(new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT, (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 20, getResources().getDisplayMetrics())));
view.setBackgroundResource(getResources().getColor(R.color.transparent));
applyButtons.addView(view);
bindAdapter();
}
private View getApplyButtonView(int stringId, int backgroundId, int iconId, View.OnClickListener onClickListener) {
final View view = inflater.inflate(R.layout.dashboard_list_card_item, null);
return view;
}
public void bindAdapter() {
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
DashboardFragment.this.lvCards.setLayoutTransition(new LayoutTransition());
DashboardFragment.this.lvCards.addFooterView(applyButtons, null, false);
if (adapter == null) {
adapter = new CardListAdapter(getActivity(), R.layout.dashboard_list_card_item, productModelContainerList);
controller = new CardListController(lvCards);
lvCards.setDropListener(this);
controller.setDragInitMode(CardListController.ON_LONG_PRESS);
lvCards.setFloatViewManager(controller);
lvCards.setOnTouchListener(controller);
lvCards.setAdapter(adapter);
}
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
DashboardFragment.this.lvCards.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
DashboardFragment.this.lvCards.setLayoutTransition(null);
}
}
Here i made some changes,, use these and let me know... otherwise i need your drawable resources to set this.
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/lstCardItem"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:background="#color/background_holo_dark" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5.33dp"
android:layout_marginLeft="11.67dp"
android:layout_marginRight="11.67dp"
android:layout_marginTop="6dp" >
<ImageView
android:id="#+id/ivCard"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:animateLayoutChanges="true"
android:scaleType="fitXY" />
<ImageView
android:id="#+id/ivCardLock"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
android:background="#color/background_holo_light"
android:scaleType="center"
android:src="#color/bgColor" />
<LinearLayout
android:id="#+id/llInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/cropBG"
android:gravity="top|right"
android:orientation="vertical"
android:paddingLeft="18dp"
android:paddingRight="18dp"
android:visibility="visible" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="right|center_horizontal"
android:gravity="center|right"
android:orientation="horizontal"
android:paddingBottom="4dp"
android:paddingTop="4dp" >
<TextView
android:id="#+id/tvCardBalance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="#+id/tvCurrency"
android:gravity="top"
android:text="10,344"
android:textColor="#android:color/white"
android:textSize="18dp"
android:typeface="serif" />
<TextView
android:id="#+id/tvCurrency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="3dp"
android:layout_marginTop="2dp"
android:gravity="top"
android:text="Currency"
android:textColor="#android:color/white"
android:textSize="10dp"
android:typeface="sans" />
<TextView
android:id="#+id/tvCardBalanceName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="pgDashboard_lblBalanceBanner"
android:textColor="#android:color/white"
android:textSize="11.33dp"
android:typeface="monospace" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/bottom_btn_bg_color" />
</LinearLayout>

Categories

Resources