Guest User

Untitled

a guest
Oct 19th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.07 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. xmlns:app="http://schemas.android.com/apk/res-auto"
  4. xmlns:tools="http://schemas.android.com/tools"
  5. android:layout_width="match_parent"
  6. android:layout_height="wrap_content"
  7. android:orientation="vertical">
  8.  
  9.  
  10. <LinearLayout
  11. android:layout_width="match_parent"
  12. android:layout_height="210dp"
  13.  
  14. android:layout_marginBottom="6dp"
  15. android:orientation="vertical"
  16. android:paddingEnd="6dp"
  17. android:paddingStart="6dp">
  18.  
  19. <RelativeLayout
  20. android:layout_width="match_parent"
  21. android:layout_height="match_parent"
  22.  
  23. >
  24.  
  25. <ImageView
  26. android:id="@+id/addimageview"
  27. android:layout_width="match_parent"
  28. android:layout_height="match_parent"
  29. android:layout_alignParentStart="true"
  30. android:layout_alignParentTop="true"
  31. android:scaleType="fitXY"
  32. app:srcCompat="@drawable/dasboard_card_four" />
  33.  
  34. <LinearLayout
  35. android:layout_width="@dimen/image_card_width"
  36. android:layout_height="@dimen/image_card"
  37. android:layout_alignLeft="@id/addimageview"
  38. android:layout_marginLeft="@dimen/inner_space_right_view"
  39. android:layout_marginTop="28dp"
  40. android:orientation="vertical">
  41.  
  42. <com.makeramen.roundedimageview.RoundedImageView xmlns:app="http://schemas.android.com/apk/res-auto"
  43. android:id="@+id/cardview_image"
  44. android:layout_width="match_parent"
  45. android:layout_height="match_parent"
  46. android:adjustViewBounds="false"
  47. android:scaleType="fitCenter"
  48. android:src="@drawable/dasboard_menu_card_icon"
  49. app:riv_border_color="#333333"
  50. app:riv_border_width="0dip"
  51. app:riv_corner_radius="6dip"
  52. app:riv_mutate_background="true"
  53. app:riv_oval="false"
  54. app:riv_tile_mode="repeat" />
  55.  
  56. <!--<ImageView-->
  57. <!--android:id="@+id/imageView3"-->
  58. <!--android:layout_width="match_parent"-->
  59. <!--android:layout_height="match_parent"-->
  60. <!--android:scaleType="centerCrop"-->
  61. <!--app:srcCompat="@drawable/dasboard_menu_card_icon" />-->
  62. </LinearLayout>
  63.  
  64. <TextView
  65. android:layout_width="wrap_content"
  66. android:layout_height="wrap_content"
  67. android:layout_alignLeft="@id/addimageview"
  68. android:layout_marginLeft="@dimen/inner_space_txt_view"
  69. android:layout_marginTop="@dimen/inner_space_top_view_check_amount"
  70. android:text="Cheque Amount :"
  71. android:textColor="@android:color/background_light"
  72. android:textSize="@dimen/text_cheque_titles"
  73. android:textStyle="bold" />
  74.  
  75. <LinearLayout
  76. android:layout_width="match_parent"
  77. android:layout_height="wrap_content"
  78. android:layout_alignLeft="@+id/addimageview"
  79. android:layout_alignRight="@+id/addimageview"
  80. android:layout_marginLeft="@dimen/chq_amount_left"
  81. android:layout_marginRight="@dimen/space_image_btn_right_small_delete"
  82. android:layout_marginTop="@dimen/inner_space_top_view_check_number"
  83. android:gravity="right"
  84. android:orientation="vertical">
  85.  
  86. <TextView
  87. android:id="@+id/chequenumber_cardtxt"
  88. android:layout_width="match_parent"
  89. android:layout_height="wrap_content"
  90. android:ellipsize="end"
  91. android:maxLines="1"
  92. android:text="51265503"
  93. android:textColor="@android:color/background_light"
  94. android:textSize="@dimen/text_cheque_titles" />
  95. </LinearLayout>
  96.  
  97. <TextView
  98. android:id="@+id/companyname_cardtxt"
  99. android:layout_width="wrap_content"
  100. android:layout_height="wrap_content"
  101. android:layout_alignLeft="@id/addimageview"
  102. android:layout_marginLeft="@dimen/inner_space_txt_view"
  103. android:layout_marginTop="@dimen/inner_space_top_view_check_number"
  104. android:text="Cheque Number :"
  105. android:textColor="@android:color/background_light"
  106. android:textSize="@dimen/text_cheque_titles"
  107. android:textStyle="bold" />
  108.  
  109. <LinearLayout
  110. android:layout_width="match_parent"
  111. android:layout_height="wrap_content"
  112. android:layout_alignLeft="@+id/addimageview"
  113. android:layout_alignRight="@+id/addimageview"
  114. android:layout_marginLeft="@dimen/chq_amount_left"
  115. android:layout_marginRight="@dimen/space_image_btn_right_small_delete"
  116. android:layout_marginTop="@dimen/inner_space_top_view_check_amount"
  117. android:gravity="right"
  118. android:orientation="vertical">
  119.  
  120. <TextView
  121. android:id="@+id/chequeamount_cardtxt"
  122. android:layout_width="match_parent"
  123. android:layout_height="match_parent"
  124. android:ellipsize="end"
  125. android:maxLines="1"
  126. android:text="$50000"
  127. android:textColor="@android:color/background_light"
  128. android:textSize="@dimen/text_cheque_titles" />
  129. </LinearLayout>
  130.  
  131. <TextView
  132. android:layout_width="wrap_content"
  133. android:layout_height="wrap_content"
  134. android:layout_alignLeft="@id/addimageview"
  135. android:layout_marginLeft="@dimen/inner_space_txt_view"
  136. android:layout_marginTop="@dimen/inner_space_top_view_check_date"
  137. android:text="Cheque Date :"
  138. android:textColor="@android:color/background_light"
  139. android:textSize="@dimen/text_cheque_titles"
  140. android:textStyle="bold" />
  141.  
  142. <LinearLayout
  143. android:layout_width="match_parent"
  144. android:layout_height="wrap_content"
  145. android:layout_alignLeft="@+id/addimageview"
  146. android:layout_alignRight="@+id/addimageview"
  147. android:layout_marginLeft="@dimen/chq_amount_left"
  148. android:layout_marginRight="@dimen/space_image_btn_right_small_delete"
  149. android:layout_marginTop="@dimen/inner_space_top_view_check_date"
  150. android:gravity="top|right"
  151. android:orientation="vertical">
  152.  
  153. <TextView
  154. android:id="@+id/chequedate_cardtxt"
  155. android:layout_width="match_parent"
  156. android:layout_height="wrap_content"
  157. android:ellipsize="end"
  158. android:maxLines="1"
  159. android:text="9-Sep-2018"
  160. android:textColor="@android:color/background_light"
  161. android:textSize="@dimen/text_cheque_titles" />
  162.  
  163. </LinearLayout>
  164.  
  165. <ImageButton
  166. android:id="@+id/imageButton"
  167. android:layout_width="wrap_content"
  168. android:layout_height="wrap_content"
  169. android:layout_alignRight="@id/addimageview"
  170. android:layout_marginRight="@dimen/space_image_btn_right_small_camera"
  171. android:layout_marginTop="26dp"
  172. android:background="@drawable/edit_icon" />
  173.  
  174. <ImageButton
  175. android:id="@+id/imageButton5"
  176. android:layout_width="wrap_content"
  177. android:layout_height="wrap_content"
  178.  
  179. android:layout_marginRight="2dp"
  180. android:layout_marginTop="26dp"
  181. android:layout_toStartOf="@+id/imageButton"
  182. android:background="@drawable/image_view_icon" />
  183.  
  184. <ImageButton
  185. android:id="@+id/delete_imgbtn"
  186. android:layout_width="wrap_content"
  187. android:layout_height="wrap_content"
  188. android:layout_alignRight="@id/addimageview"
  189. android:layout_marginRight="@dimen/space_image_btn_right_small_delete"
  190. android:layout_marginTop="26dp"
  191. android:background="@drawable/delete_icon" />
  192.  
  193. </RelativeLayout>
  194.  
  195.  
  196. </LinearLayout>
  197.  
  198. <View
  199. android:id="@+id/view2"
  200. android:layout_width="match_parent"
  201. android:layout_height="4dp"
  202. android:background="@color/gray_btn_bg_color" />
  203.  
  204. </LinearLayout>
  205.  
  206. package com.example.abc.ez_khata;
  207.  
  208. import android.content.Context;
  209. import android.support.annotation.NonNull;
  210. import android.support.v7.widget.RecyclerView;
  211. import android.view.LayoutInflater;
  212. import android.view.View;
  213. import android.view.ViewGroup;
  214. import android.widget.ImageView;
  215. import android.widget.TextView;
  216.  
  217. import java.util.List;
  218.  
  219. public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.MyViewHolder> {
  220.  
  221.  
  222. Context mContext;
  223. List<Clients_data> mData;
  224.  
  225.  
  226. public RecyclerViewAdapter(Context mContext ,List<Clients_data> mData){
  227.  
  228. this.mContext = mContext;
  229. this.mData = mData;
  230. }
  231.  
  232.  
  233. @NonNull
  234. @Override
  235. public MyViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
  236.  
  237. View v;
  238. v = LayoutInflater.from(mContext).inflate(R.layout.lst_records,viewGroup,false);
  239. MyViewHolder vholder = new MyViewHolder(v);
  240.  
  241. return vholder;
  242. }
  243.  
  244. @Override
  245. public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
  246.  
  247. holder.imageview.setImageResource(mData.get(position).getChq_image());
  248.  
  249. //holder.imageview.setBackground(mData.get(position).getChq_image());
  250. holder.chequeamount_cardtxt.setText(mData.get(position).getChq_amount());
  251. holder.chequedate_cardtxt.setText(mData.get(position).getChq_date());
  252. holder.chequenumber_cardtxt.setText(mData.get(position).getChq_no());
  253.  
  254.  
  255. }
  256.  
  257. @Override
  258. public int getItemCount() {
  259. return mData.size();
  260. }
  261.  
  262. public static class MyViewHolder extends RecyclerView.ViewHolder {
  263.  
  264. private ImageView imageview;
  265. private TextView chequeamount_cardtxt;
  266. private TextView chequenumber_cardtxt;
  267. private TextView chequedate_cardtxt;
  268.  
  269. public MyViewHolder(@NonNull View itemView) {
  270. super(itemView);
  271.  
  272.  
  273. imageview = (ImageView) itemView.findViewById(R.id.cardview_image);
  274. chequeamount_cardtxt = (TextView)itemView.findViewById(R.id.chequeamount_cardtxt);
  275. chequedate_cardtxt = (TextView)itemView.findViewById(R.id.chequedate_cardtxt);
  276. chequenumber_cardtxt = (TextView)itemView.findViewById(R.id.chequenumber_cardtxt);
  277. }
  278. }
  279.  
  280. }
Add Comment
Please, Sign In to add comment