private static AlertDialog createDialog(final Context context) { AppCompatTextView messageTextView = new AppCompatTextView(context); messageTextView.setTextSize(16f); messageTextView.setText(context.getString(R.string.download_manager_disabled)); messageTextView.setPadding(50, 50, 50, 0); messageTextView.setTextColor(ContextCompat.getColor(context, R.color.black)); return new AlertDialog.Builder(context) .setView(messageTextView) .setPositiveButton("ok", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { enableDownloadManager(context); } }) .setCancelable(false) .create(); }
public PackageViewHolder(View itemView, OnRecyclerViewItemClickListener listener) { super(itemView); textViewPackageName = (AppCompatTextView) itemView.findViewById(R.id.textViewPackageName); textViewStatus = (AppCompatTextView) itemView.findViewById(R.id.textViewStatus); textViewTime = (AppCompatTextView) itemView.findViewById(R.id.textViewTime); textViewAvatar = (AppCompatTextView) itemView.findViewById(R.id.textViewAvatar); textViewRemove = (AppCompatTextView) itemView.findViewById(R.id.textViewRemove); imageViewRemove = (ImageView) itemView.findViewById(R.id.imageViewRemove); circleImageViewAvatar = (CircleImageView) itemView.findViewById(R.id.circleImageView); layoutMain = (LinearLayout) itemView.findViewById(R.id.layoutPackageItemMain); wrapperView = itemView.findViewById(R.id.layoutPackageItem); this.listener = listener; itemView.setOnClickListener(this); itemView.setOnCreateContextMenuListener(this); }
public PackageStatusViewHolder(View itemView) { super(itemView); textViewLocation = (AppCompatTextView) itemView.findViewById(R.id.textViewStatus); textViewTime = (AppCompatTextView) itemView.findViewById(R.id.textViewTime); timeLine = (Timeline) itemView.findViewById(R.id.timeLine); contactCard = (CardView) itemView.findViewById(R.id.contactCard); textViewPhone = (AppCompatTextView) itemView.findViewById(R.id.textViewPhone); // Just handle the click event in adapter // No need to set an {@link OnRecyclerViewItemClickListener} contactCard.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String uri = textViewPhone.getText().toString(); if (uri.length() > 0) { Intent intent = new Intent(Intent.ACTION_DIAL); intent.setData(Uri.parse("tel:" + uri)); context.startActivity(intent); } } }); }
public HeaderViewHolder(View itemView) { super(itemView); textViewCompany = (AppCompatTextView) itemView.findViewById(R.id.textViewCompany); textViewNumber = (AppCompatTextView) itemView.findViewById(R.id.textViewPackageNumber); textViewName = (AppCompatTextView) itemView.findViewById(R.id.textViewName); textViewCompany.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (aPackage.getCompany() != null) { Intent intent = new Intent(context, CompanyDetailActivity.class); intent.putExtra(CompanyDetailActivity.COMPANY_ID, aPackage.getCompany()); context.startActivity(intent, ActivityOptions.makeSceneTransitionAnimation((PackageDetailsActivity)context).toBundle()); } } }); }
protected void showInfo(String header, String desc, @Nullable Drawable drawable, boolean error) { hideKeyboard(); AppCompatTextView infoHeader = (AppCompatTextView) llBottomSheet.findViewById(R.id.info_header); AppCompatTextView infoDesc = (AppCompatTextView) llBottomSheet.findViewById(R.id.info_desc); AppCompatImageView infoImg = (AppCompatImageView) llBottomSheet.findViewById(R.id.info_img); if (error) { llBottomSheet.findViewById(R.id.info_img).setVisibility(View.GONE); ((AppCompatButton) findViewById(R.id.ok_dimiss)).setText("Close"); } else { llBottomSheet.findViewById(R.id.info_img).setVisibility(View.VISIBLE); ((AppCompatButton) findViewById(R.id.ok_dimiss)).setText("Ok"); } infoHeader.setText(header); infoDesc.setText(desc); if (drawable != null) infoImg.setImageDrawable(drawable); bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); }
public ViewHolder(final View itemView) { super(itemView); tv_relatedCompanyName = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_relatedCompanyName); tv_fundName = (AppCompatTextView) itemView.findViewById(R.id.tv_fundName); tv_amountRmb = (AppCompatTextView) itemView.findViewById(R.id.tv_amountRmb); tv_createDate = (AppCompatTextView) itemView.findViewById(R.id.tv_createDate); rl_content = (RelativeLayout) itemView.findViewById(R.id.rl_content); rl_content.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { T_AccountFundDetailsEntity.RowsEntity rowsEntity = list.get(getLayoutPosition()); T_AccountFundDetailsActivity_.intent(getActivity()).extra("rowsEntity", rowsEntity).start(); } }); }
public ViewHolder(final View itemView) { super(itemView); tv_salesorder = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_salesorder); tv_statusFormatCn = (AppCompatTextView) itemView.findViewById(R.id.tv_statusFormatCn); tv_orderform_amount = (AppCompatTextView) itemView.findViewById(R.id.tv_orderform_amount); tv_orderform_createDate = (AppCompatTextView) itemView.findViewById(R.id.tv_orderform_createDate); tv_orderform_foreignName = (AppCompatTextView) itemView.findViewById(R.id.tv_orderform_foreignName); tv_orderform_code = (AppCompatTextView) itemView.findViewById(R.id.tv_orderform_code); tv_orderItemName = (AppCompatTextView) itemView.findViewById(R.id.tv_orderItemName); tv_customerPurchaseOrder = (AppCompatTextView) itemView.findViewById(R.id.tv_customerPurchaseOrder); rl_content = (RelativeLayout) itemView.findViewById(R.id.rl_content); rl_content.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { T_OrderFormEntity.RowsEntity rowsEntity = list.get(getLayoutPosition()); T_OrderFormDetailsActivity_.intent(getActivity()).extra(AppDelegate.ORDER_ID, rowsEntity.getId()).start(); } }); }
public ViewHolder(final View itemView) { super(itemView); tv_storageListGrid_deliveryInvoiceCode = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_storageListGrid_deliveryInvoiceCode); tv_storageListGrid_blNo = (AppCompatTextView) itemView.findViewById(R.id.tv_storageListGrid_blNo); tv_storageListGrid_businessEnterpriseName = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_storageListGrid_businessEnterpriseName); tv_storageListGrid_storageStatus = (AppCompatTextView) itemView.findViewById(R.id.tv_storageListGrid_storageStatus); tv_storageListGrid_deliveryDate = (AppCompatTextView) itemView.findViewById(R.id.tv_storageListGrid_deliveryDate); rl_content = (RelativeLayout) itemView.findViewById(R.id.rl_content); rl_content.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { CB_ManageListEntity.RowsEntity rowsEntity = list.get(getLayoutPosition()); CB_ManageDetailsActivity_.intent(getActivity()).extra(AppDelegate.ID, rowsEntity.getId()) .extra(AppDelegate.TOOLBAR_TITLE, rowsEntity.getDeliveryInvoiceCode()).start(); } }); }
public ViewHolder(final View itemView) { super(itemView); tv_declare_manage_code = (AppCompatTextView) itemView.findViewById(R.id.tv_declare_manage_code); tv_declare_manage_createDate = (AppCompatTextView) itemView.findViewById(R.id.tv_declare_manage_createDate); tv_declare_manage_blNo = (AppCompatTextView) itemView.findViewById(R.id.tv_declare_manage_blNo); tv_declare_manage_customsFlag = (AppCompatTextView) itemView.findViewById(R.id.tv_declare_manage_customsFlag); tv_declare_manage_actualQuantity = (AppCompatTextView) itemView.findViewById(R.id.tv_declare_manage_actualQuantity); tv_declare_manage_packageQuantity = (AppCompatTextView) itemView.findViewById(R.id.tv_declare_manage_packageQuantity); tv_declare_manage_exportPort = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_declare_manage_exportPort); tv_declare_manage_destinationPort = (AppCompatTextView) itemView.findViewById(R.id.tv_declare_manage_destinationPort); rl_content = (RelativeLayout) itemView.findViewById(R.id.rl_content); rl_content.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { CB_DeclareManageEntity.RowsEntity rowsEntity = list.get(getLayoutPosition()); CB_ManageDetailsActivity_.intent(getActivity()).extra(AppDelegate.ID, rowsEntity.getOrderId()) .extra(AppDelegate.TOOLBAR_TITLE, rowsEntity.getCode()) .extra(AppDelegate.IS_CUSTOMS_FLAG, rowsEntity.isCustomsFlag()) .extra(AppDelegate.MANAGE_UI_NAME, toolbarTitle) .start(); } }); }
public ViewHolder(final View itemView) { super(itemView); tv_list_manage_deliveryInvoiceCode = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_list_manage_deliveryInvoiceCode); tv_list_manage_forwarderConfirmed = (AppCompatTextView) itemView.findViewById(R.id.tv_list_manage_forwarderConfirmed); tv_list_manage_deliveryDate = (AppCompatTextView) itemView.findViewById(R.id.tv_list_manage_deliveryDate); tv_list_manage_customsAreaEntryStatus = (AppCompatTextView) itemView.findViewById(R.id.tv_list_manage_customsAreaEntryStatus); tv_list_manage_enumber = (AppCompatTextView) itemView.findViewById(R.id.tv_listmanage_enumber); tv_list_manage_inventorynum = (AppCompatTextView) itemView.findViewById(R.id.tv_listmanage_inventorynum); tv_list_manage_inwarehousenum = (AppCompatTextView) itemView.findViewById(R.id.tv_listmanage_inwarehousenum); rl_content = (RelativeLayout) itemView.findViewById(R.id.rl_content); rl_content.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { CB_ManageListEntity.RowsEntity rowsEntity = list.get(getLayoutPosition()); CB_ManageDetailsActivity_.intent(getActivity()).extra(AppDelegate.ID, rowsEntity.getId()) .extra(AppDelegate.MANAGE_UI_NAME, toolbarTitle) .extra(AppDelegate.TOOLBAR_TITLE, rowsEntity.getDeliveryInvoiceCode()).start(); } }); }
public ViewHolder(final View itemView) { super(itemView); tv_count = (AppCompatTextView) itemView.findViewById(R.id.tv_count); tv_shippingDetailList_nameCn = (AppCompatTextView) itemView.findViewById(R.id.tv_shippingDetailList_nameCn); tv_shippingDetailList_quantity = (AppCompatTextView) itemView.findViewById(R.id.tv_shippingDetailList_quantity); tv_shippingDetailList_packingUnitEn = (AppCompatTextView) itemView.findViewById(R.id.tv_shippingDetailList_packingUnitEn); tv_shippingDetailList_grossWeight = (AppCompatTextView) itemView.findViewById(R.id.tv_shippingDetailList_grossWeight); tv_shippingDetailList_vol = (AppCompatTextView) itemView.findViewById(R.id.tv_shippingDetailList_vol); tv_shippingDetailList_netWeight = (AppCompatTextView) itemView.findViewById(R.id.tv_shippingDetailList_netWeight); // 整个条目点击事件 itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { } }); }
public ViewHolder(final View itemView) { super(itemView); tv_count = (AppCompatTextView) itemView.findViewById(R.id.tv_count); tv_container_typeName = (AppCompatTextView) itemView.findViewById(R.id.tv_container_typeName); tv_container_count = (AppCompatTextView) itemView.findViewById(R.id.tv_container_count); tv_container_remark = (AppCompatTextView) itemView.findViewById(R.id.tv_container_remark); tv_container_sealNo = (AppCompatTextView) itemView.findViewById(R.id.tv_container_sealNo); tv_container_carNo = (AppCompatTextView) itemView.findViewById(R.id.tv_container_carNo); tv_container_whiteCardNo = (AppCompatTextView) itemView.findViewById(R.id.tv_container_whiteCardNo); tv_container_driverName = (AppCompatTextView) itemView.findViewById(R.id.tv_container_driverName); tv_container_driverPhone = (AppCompatTextView) itemView.findViewById(R.id.tv_container_driverPhone); // 整个条目点击事件 itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { } }); }
public ViewHolder(final View itemView) { super(itemView); tv_warning_export_invoice_number = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_warning_export_invoice_number); tv_warning_foreign_businessman = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_warning_foreign_businessman); tv_warning_invoice_unit = (AppCompatTextView) itemView.findViewById(R.id.tv_warning_invoice_unit); tv_warning_amount = (AppCompatTextView) itemView.findViewById(R.id.tv_warning_amount); tv_warning_invoice_date = (AppCompatTextView) itemView.findViewById(R.id.tv_warning_invoice_date); tv_warning_declare_date = (AppCompatTextView) itemView.findViewById(R.id.tv_warning_declare_date); tv_warning_approve_expiration_date = (AppCompatTextView) itemView.findViewById(R.id.tv_warning_approve_expiration_date); tv_warning_order_serial_number = (AppCompatTextView) itemView.findViewById(R.id.tv_warning_order_serial_number); tv_warning_po_number = (AppCompatTextView) itemView.findViewById(R.id.tv_warning_po_number); tv_warning_create_date = (AppCompatTextView) itemView.findViewById(R.id.tv_warning_create_date); rl_content = (RelativeLayout) itemView.findViewById(R.id.rl_content); rl_content.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { } }); }
public ViewHolder(final View itemView) { super(itemView); tv_count = (AppCompatTextView) itemView.findViewById(R.id.tv_count); tv_detailList_hsCode = (AppCompatTextView) itemView.findViewById(R.id.tv_detailList_hsCode); tv_detailList_nameCn = (AppCompatTextView) itemView.findViewById(R.id.tv_detailList_nameCn); tv_detailList_nameEn = (AppCompatTextView) itemView.findViewById(R.id.tv_detailList_nameEn); tv_detailList_quantity = (AppCompatTextView) itemView.findViewById(R.id.tv_detailList_quantity); tv_detailList_unitCn = (AppCompatTextView) itemView.findViewById(R.id.tv_detailList_unitCn); tv_detailList_saleUnitPrice = (AppCompatTextView) itemView.findViewById(R.id.tv_detailList_saleUnitPrice); tv_detailList_saleAmount = (AppCompatTextView) itemView.findViewById(R.id.tv_detailList_saleAmount); tv_detailList_packingAmount = (AppCompatTextView) itemView.findViewById(R.id.tv_detailList_packingAmount); tv_detailList_packingUnitInfo = (AppCompatTextView) itemView.findViewById(R.id.tv_detailList_packingUnitInfo); tv_detailList_unitNWeight = (AppCompatTextView) itemView.findViewById(R.id.tv_detailList_unitNWeight); tv_detailList_unitGWeight = (AppCompatTextView) itemView.findViewById(R.id.tv_detailList_unitGWeight); tv_detailList_vol = (AppCompatTextView) itemView.findViewById(R.id.tv_detailList_vol); // 整个条目点击事件 itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { } }); }
public ViewHolder(final View itemView) { super(itemView); tv_invoice_code = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_invoice_code); tv_type = (AppCompatTextView) itemView.findViewById(R.id.tv_type); tv_invoice_amount = (AppCompatTextView) itemView.findViewById(R.id.tv_invoice_amount); tv_createDate = (AppCompatTextView) itemView.findViewById(R.id.tv_createDate); tv_confirmDate = (AppCompatTextView) itemView.findViewById(R.id.tv_confirmDate); tv_saleOrder = (AppCompatTextView) itemView.findViewById(R.id.tv_saleOrder); tv_orderCode = (AppCompatTextView) itemView.findViewById(R.id.tv_orderCode); tv_invoice_status = (AppCompatTextView) itemView.findViewById(R.id.tv_invoice_status); tv_accountName = (AppCompatTextView) itemView.findViewById(R.id.tv_accountName); tv_draweerName = (AppCompatTextView) itemView.findViewById(R.id.tv_draweerName); rl_content = (RelativeLayout) itemView.findViewById(R.id.rl_content); rl_content.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { T_InvoiceInformationEntity.RowsEntity rowsEntity = list.get(getLayoutPosition()); T_InvoiceInformationProductsActivity_.intent(getActivity()).extra("rowsEntity", rowsEntity).start(); } }); }
public ViewHolder(final View itemView) { super(itemView); tv_invoice_notice_orderCode = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_invoice_notice_orderCode); tv_account_name = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_account_name); tv_status = (AppCompatTextView) itemView.findViewById(R.id.tv_status); tv_adviceDate = (AppCompatTextView) itemView.findViewById(R.id.tv_adviceDate); tv_amount = (AppCompatTextView) itemView.findViewById(R.id.tv_amount); tv_code = (AppCompatTextView) itemView.findViewById(R.id.tv_code); tv_invoice_notice_remark = (AppCompatTextView) itemView.findViewById(R.id.tv_invoice_notice_remark); rl_content = (RelativeLayout) itemView.findViewById(R.id.rl_content); rl_content.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { T_InvoiceNoticeEntity.RowsEntity rowsEntity = list.get(getLayoutPosition()); // 进入详情页 T_InvoiceNoticeDetailsActivity_.intent(getActivity()).extra("rowsEntity", rowsEntity).start(); } }); }
public ViewHolder(final View itemView) { super(itemView); tv_nameCn = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_top_left); tv_down_left = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_down_left); tv_country = (AppCompatTextView) itemView.findViewById(R.id.tv_top_right); tv_status = (AppCompatTextView) itemView.findViewById(R.id.tv_down_right); ll_content = (LinearLayout) itemView.findViewById(R.id.ll_content); ll_content.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { T_ContactsCompanyEntity.RowsEntity rowsEntity = list.get(getLayoutPosition()); T_ContactsCompanyDetailsActivity_.intent(T_ContactsCompanyListFragment.this).extra(AppDelegate.ROWS_ENTITY, rowsEntity).start(); } }); }
public ViewHolder(final View itemView) { super(itemView); tv_apply_code = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_apply_code); tv_saleOrders = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_saleOrders); tv_actualPaymentAmount = (AppCompatTextView) itemView.findViewById(R.id.tv_actualPaymentAmount); tv_applyPaymentAmount = (AppCompatTextView) itemView.findViewById(R.id.tv_applyPaymentAmount); tv_status = (AppCompatTextView) itemView.findViewById(R.id.tv_status); tv_applyDate = (AppCompatTextView) itemView.findViewById(R.id.tv_applyDate); rl_content = (RelativeLayout) itemView.findViewById(R.id.rl_content); rl_content.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { T_ApplyPaymentActivityEntity.RowsEntity rowsEntity = list.get(getLayoutPosition()); ArrayList<String> datas = new ArrayList<>(); datas.add(rowsEntity.getId()); datas.add(rowsEntity.getDraweeBankName()); datas.add(rowsEntity.getDraweeBankAccount()); T_ApplyPaymentDetailsActivity_.intent(T_ApplyPaymentActivity.this).stringArrayListExtra("datas", datas).start(); } }); }
public ViewHolder(final View itemView) { super(itemView); tv_history = (AppCompatTextView) itemView.findViewById(R.id.tv_history); tv_clear_history = (AppCompatTextView) itemView.findViewById(R.id.tv_clear_history); // 整个条目点击事件 itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (getLayoutPosition() == list.size() - 1) { Set<String> emptySet = new HashSet<>(); getSharedPreferences(AppDelegate.SP_SEARCH_HISTORY, MODE_PRIVATE).edit().putStringSet("history_" + TAG + accountNature, emptySet).commit(); strings.clear(); searchHistoryAdapter.notifyDataSetChanged(); } else { editText.setText(list.get(getLayoutPosition())); } } }); }
public ViewHolder(final View itemView) { super(itemView); tv_history = (AppCompatTextView) itemView.findViewById(R.id.tv_history); tv_clear_history = (AppCompatTextView) itemView.findViewById(R.id.tv_clear_history); // 整个条目点击事件 itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (getLayoutPosition() == list.size() - 1) { Set<String> emptySet = new HashSet<>(); getSharedPreferences("SP_SEARCH_HISTORY", MODE_PRIVATE).edit().putStringSet("history_" + TAG, emptySet).commit(); strings.clear(); searchHistoryAdapter.notifyDataSetChanged(); } else { editText.setText(list.get(getLayoutPosition())); } } }); }
public ViewHolder(final View itemView) { super(itemView); tv_count = (AppCompatTextView) itemView.findViewById(R.id.tv_count); tv_split_orderCode = (AppCompatTextView) itemView.findViewById(R.id.tv_split_orderCode); tv_split_zpAmount = (AppCompatTextView) itemView.findViewById(R.id.tv_split_zpAmount); tv_split_slipedAmount = (AppCompatTextView) itemView.findViewById(R.id.tv_split_slipedAmount); tv_split_amount = (AppCompatTextView) itemView.findViewById(R.id.tv_split_amount); tv_split_actualAmount = (AppCompatTextView) itemView.findViewById(R.id.tv_split_actualAmount); tv_split_slipCompleted = (AppCompatTextView) itemView.findViewById(R.id.tv_split_slipCompleted); // 整个条目点击事件 itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { } }); }
public ViewHolder(final View itemView) { super(itemView); tv_notice_foreign_exchang_amount = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_top_left); tv_foreignName = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_down_left); tv_notice_foreign_exchang_status = (AppCompatTextView) itemView.findViewById(R.id.tv_top_right); tv_notice_foreign_exchang_createDate = (AppCompatTextView) itemView.findViewById(R.id.tv_down_right); ll_content = (LinearLayout) itemView.findViewById(R.id.ll_content); ll_content.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { T_NoticeForeignExchangeEntity.RowsEntity rowsEntity = list.get(getLayoutPosition()); T_NoticeForeignExchangeDetailsActivity_.intent(T_NoticeForeignExchangeActivity.this) .extra(AppDelegate.ROWS_ENTITY, rowsEntity).start(); } }); }
@NonNull private TabLayout setTabLayout(View view) { TabLayout tabLayout = (TabLayout) view.findViewById(R.id.tab_layout_rewards); tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.available_rewards_tab))); tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.exchanged_rewards_tab))); tabLayout.setTabGravity(TabLayout.GRAVITY_FILL); Typeface typeface = Typeface.createFromAsset(getContext().getAssets(), "fonts/Nunito-Regular.ttf"); ViewGroup viewGroup = (ViewGroup) tabLayout.getChildAt(0); for (int i = 0; i < 2; i++) { AppCompatTextView appCompatTextView = (AppCompatTextView) ((ViewGroup) viewGroup .getChildAt(i)).getChildAt(1); appCompatTextView.setTypeface(typeface, Typeface.NORMAL); } return tabLayout; }
@Override public void initView() { repleaceFragment(FragmentFactory.getFrament(0)); tvCenter = findView(R.id.tv_center); ivRight = findView(R.id.iv_right); toolbar = findView(R.id.toolbar); toolbar.setTitleTextColor(Color.WHITE); toolbar.setTitle(""); setSupportActionBar(toolbar); ActionBar ab = getSupportActionBar(); ab.setDisplayHomeAsUpEnabled(true); navigationView = findView(R.id.nav_view); View headerView = navigationView.getHeaderView(0); tvHead = (AppCompatTextView) headerView.findViewById(R.id.tv_head); navigationView.setBackgroundColor(getResources().getColor(R.color.color0AA770)); drawerLayout = findView(R.id.drawer_layout); toggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.open_drawer, R.string.close_drawer); drawerLayout.setDrawerListener(toggle); setupDrawerContent(navigationView); content = findView(R.id.content); }
private void init(Context context) { setOrientation(HORIZONTAL); //Title mTitleTextView = new AppCompatTextView(context); mTitleTextView.setLayoutParams(new LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); mTitleTextView.setTypeface(Typeface.DEFAULT_BOLD); //Value mValueTextView = new AppCompatTextView(context); mValueTextView.setLayoutParams(new LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); addView(mTitleTextView); addView(mValueTextView); }
private void checkItemCount() { final int count = mAdapter.getItemCount(); if (count == 0) { final View stubView = mStubNoItem.inflate(); final AppCompatTextView tvToBuy = (AppCompatTextView) stubView.findViewById(R.id.tv_stub_to_buy); tvToBuy.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getContext(), "你该购物啦!", Toast.LENGTH_SHORT).show(); } }); mRecyclerView.setVisibility(View.GONE); } else { mRecyclerView.setVisibility(View.VISIBLE); } }
@Override public void onBindView(@Nullable Bundle savedInstanceState, View rootView) { final int size = ITEMS.size(); for (int i = 0; i < size; i++) { LayoutInflater.from(getContext()).inflate(R.layout.bottom_item_icon_text_layout, mBottomBar); final RelativeLayout item = (RelativeLayout) mBottomBar.getChildAt(i); //设置每个item的点击事件 item.setTag(i); item.setOnClickListener(this); final IconTextView itemIcon = (IconTextView) item.getChildAt(0); final AppCompatTextView itemTitle = (AppCompatTextView) item.getChildAt(1); final BottomTabBean bean = TAB_BEANS.get(i); //初始化数据 itemIcon.setText(bean.getICON()); itemTitle.setText(bean.getTITLE()); if (i == mIndexDelegate) { itemIcon.setTextColor(mClickedColor); itemTitle.setTextColor(mClickedColor); } } final ISupportFragment[] delegateArray = ITEM_DELEGATES.toArray(new ISupportFragment[size]); getSupportDelegate().loadMultipleRootFragment(R.id.bottom_bar_delegate_container, mIndexDelegate, delegateArray); }
private void showInfo(String header, String desc, @Nullable Drawable drawable, boolean error) { hideKeyboard(); AppCompatTextView infoHeader = (AppCompatTextView) llBottomSheet.findViewById(R.id.info_header); AppCompatTextView infoDesc = (AppCompatTextView) llBottomSheet.findViewById(R.id.info_desc); AppCompatImageView infoImg = (AppCompatImageView) llBottomSheet.findViewById(R.id.info_img); if (error) { llBottomSheet.findViewById(R.id.info_img).setVisibility(View.GONE); ((AppCompatButton) findViewById(R.id.ok_dimiss)).setText("Close"); } else { llBottomSheet.findViewById(R.id.info_img).setVisibility(View.VISIBLE); ((AppCompatButton) findViewById(R.id.ok_dimiss)).setText("Ok"); } infoHeader.setText(header); infoDesc.setText(desc); if (drawable != null) infoImg.setImageDrawable(drawable); bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); }
@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); editGeohash = (AppCompatEditText) view.findViewById(R.id.edit_hash); editLat = (AppCompatEditText) view.findViewById(R.id.edit_lat); editLon = (AppCompatEditText) view.findViewById(R.id.edit_lon); textPrecision = (AppCompatTextView) view.findViewById(R.id.text_precision); seekPrecision = (AppCompatSeekBar) view.findViewById(R.id.seek_precision); editGeohash.addTextChangedListener(hashTextWatcher); editLat.addTextChangedListener(locationTextWatcher); editLon.addTextChangedListener(locationTextWatcher); seekPrecision.setOnSeekBarChangeListener(this); location = new Location("geohash_example"); textPrecision.setText("Precision: " + 1); }
public SwitchViewHolder(View itemView) { super(itemView); mSwitchTextView = (AppCompatTextView) itemView.findViewById(R.id.switch_name_tv); mSwitchToggel = (ToggleButton) itemView.findViewById(R.id.switch_status_toggel); ViewGroup.LayoutParams params = mSwitchToggel.getLayoutParams(); int square = Resources.getSystem().getDisplayMetrics().widthPixels / 2; params.width = square; params.height = square - 50; mSwitchToggel.setLayoutParams(params); }
/** * Font * @param context * @param path */ public static void getCalligraphy(Context context, String path) { CalligraphyConfig.initDefault(new CalligraphyConfig.Builder() .setDefaultFontPath(path) .addCustomStyle(AppCompatTextView.class, android.R.attr.textViewStyle) .addCustomStyle(TextView.class, android.R.attr.textViewStyle) .addCustomStyle(EditText.class, android.R.attr.editTextStyle) .setFontAttrId(R.attr.fontPath) .build()); Extras.getInstance().saveTypeface(path); }
PackageHolder(View itemView, OnRecyclerViewItemClickListener listener) { super(itemView); avatar = (CircleImageView) itemView.findViewById(R.id.circleImageView); textViewPackageName = (AppCompatTextView) itemView.findViewById(R.id.textViewPackageName); textViewStatus = (AppCompatTextView) itemView.findViewById(R.id.textViewStatus); textViewTime = (AppCompatTextView) itemView.findViewById(R.id.textViewTime); textViewAvatar = (AppCompatTextView) itemView.findViewById(R.id.textViewAvatar); this.listener = listener; itemView.setOnClickListener(this); }
CompanyHolder(View itemView, OnRecyclerViewItemClickListener listener) { super(itemView); avatar = (CircleImageView) itemView.findViewById(R.id.imageViewAvatar); textViewAvatar = (AppCompatTextView) itemView.findViewById(R.id.textViewAvatar); textViewCompanyName = (AppCompatTextView) itemView.findViewById(R.id.textViewCompanyName); textViewCompanyTel = (AppCompatTextView) itemView.findViewById(R.id.textViewCompanyTel); this.listener = listener; itemView.setOnClickListener(this); }
public NormalViewHolder(View itemView, OnRecyclerViewItemClickListener listener) { super(itemView); avatar = (CircleImageView) itemView.findViewById(R.id.imageViewAvatar); textViewAvatar = (AppCompatTextView) itemView.findViewById(R.id.textViewAvatar); textViewCompanyName = (AppCompatTextView) itemView.findViewById(R.id.textViewCompanyName); textViewCompanyTel = (AppCompatTextView) itemView.findViewById(R.id.textViewCompanyTel); this.listener = listener; itemView.setOnClickListener(this); }
public WithHeaderViewHolder(View itemView, OnRecyclerViewItemClickListener listener) { super(itemView); avatar = (CircleImageView) itemView.findViewById(R.id.imageViewAvatar); textViewAvatar = (AppCompatTextView) itemView.findViewById(R.id.textViewAvatar); textViewCompanyName = (AppCompatTextView) itemView.findViewById(R.id.textViewCompanyName); textViewCompanyTel = (AppCompatTextView) itemView.findViewById(R.id.textViewCompanyTel); stickyHeaderText = (AppCompatTextView) itemView.findViewById(R.id.headerText); this.listener = listener; itemView.setOnClickListener(this); }
private void addTextTab(final int position, String title) { TextView tab = new AppCompatTextView(getContext()); tab.setText(title); tab.setGravity(Gravity.CENTER); tab.setSingleLine(); addTab(position, tab); }
protected void initStyle(int style, String defaultTitle) { TypedArray ta = obtainStyledAttributes(style, R.styleable.luhnStyle); String fontName = ta.getString(R.styleable.luhnStyle_luhn_typeface); String title = ta.getString(R.styleable.luhnStyle_luhn_title); includeCalligraphy(fontName); initViews(); initBottomSheet(); retrievePin = ta.getBoolean(R.styleable.luhnStyle_luhn_show_pin, false); ((AppCompatTextView) findViewById(R.id.toolbar_title)).setText(TextUtils.isEmpty(title) ? defaultTitle : title); findViewById(R.id.btn_proceed).setBackground(ta.getDrawable(R.styleable.luhnStyle_luhn_btn_verify_selector)); findViewById(R.id.toolbar).setBackgroundColor(ta.getColor(R.styleable.luhnStyle_luhn_show_toolbar_color, ContextCompat.getColor(this, R.color.ln_colorPrimary))); }
public ViewHolder(final View itemView) { super(itemView); tv_saleOrder = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_top_left); tv_orderCommodityName = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_down_left); tv_orderCommodityAmount = (AppCompatTextView) itemView.findViewById(R.id.tv_top_right); tv_createDate = (AppCompatTextView) itemView.findViewById(R.id.tv_down_right); ll_content = (LinearLayout) itemView.findViewById(R.id.ll_content); ll_content.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { } }); }