本文整理汇总了Java中com.mikepenz.iconics.view.IconicsImageView类的典型用法代码示例。如果您正苦于以下问题:Java IconicsImageView类的具体用法?Java IconicsImageView怎么用?Java IconicsImageView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IconicsImageView类属于com.mikepenz.iconics.view包,在下文中一共展示了IconicsImageView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convert
import com.mikepenz.iconics.view.IconicsImageView; //导入依赖的package包/类
@Override
protected void convert(BaseViewHolder holder, Content content) {
if (content != null) {
IconicsImageView typeIndicator = holder.getView(R.id.type);
if (content.isDir()) {
typeIndicator.setIcon(Octicons.Icon.oct_file_directory);
} else if (content.isFile()) {
typeIndicator.setIcon(Octicons.Icon.oct_file_binary);
} else if (content.isSubmodule()) {
typeIndicator.setIcon(Octicons.Icon.oct_file_submodule);
} else {
typeIndicator.setIcon(Octicons.Icon.oct_file_symlink_file);
}
holder.setText(R.id.file_name, content.name);
}
}
示例2: convert
import com.mikepenz.iconics.view.IconicsImageView; //导入依赖的package包/类
@Override
protected void convert(BaseViewHolder holder, Content content) {
IconicsImageView typeIndicator = holder.getView(R.id.type);
if (content.isDir()) {
typeIndicator.setIcon(Octicons.Icon.oct_file_directory);
}
else if (content.isFile()) {
typeIndicator.setIcon(Octicons.Icon.oct_file_binary);
}
else if (content.isSubmodule()) {
typeIndicator.setIcon(Octicons.Icon.oct_file_submodule);
}
else {
typeIndicator.setIcon(Octicons.Icon.oct_file_symlink_file);
}
holder.setText(R.id.file_name, content.name);
}
示例3: isPolicyRespected
import com.mikepenz.iconics.view.IconicsImageView; //导入依赖的package包/类
@Override
public boolean isPolicyRespected() {
TextView textView = (TextView) getView().findViewById(R.id.enableAccessTxtBt);
IconicsImageView imageView = (IconicsImageView) getView().findViewById(R.id.intro_enablenNotifyImage);
/*if () {
AppLogger.info("Lockscreen is turned off!");
textView.setText(R.string.disableSLBTLockDisabled);
textView.setClickable(false);
imageView.setImageDrawable(new IconicsDrawable(getActivity()).icon(GoogleMaterial.Icon.gmd_check_circle));
return true;
}*/
return true;
}
示例4: getView
import com.mikepenz.iconics.view.IconicsImageView; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, @NonNull ViewGroup parent) {
View row;
if (convertView == null) {
LayoutInflater inflater = getActivity().getLayoutInflater();
row = inflater.inflate(R.layout.item_forum_type, parent, false);
} else {
row = convertView;
}
IconicsImageView icon = (IconicsImageView) row.findViewById(R.id.forum_type_icon);
TextView text = (TextView) row.findViewById(R.id.forum_type_text);
text.setText(HiUtils.BS_TYPES[position]);
if (position == HiUtils.getBSTypeIndexByFid(HiSettingsHelper.getInstance().getBSTypeId())) {
icon.setImageDrawable(new IconicsDrawable(getActivity(), HiUtils.BS_TYPE_ICONS[position]).color(ColorHelper.getColorAccent(getActivity())).sizeDp(20));
text.setTextColor(ColorHelper.getColorAccent(getActivity()));
} else {
icon.setImageDrawable(new IconicsDrawable(getActivity(), HiUtils.BS_TYPE_ICONS[position]).color(ColorHelper.getTextColorPrimary(getActivity())).sizeDp(20));
text.setTextColor(ColorHelper.getTextColorPrimary(getActivity()));
}
return row;
}
示例5: setSize
import com.mikepenz.iconics.view.IconicsImageView; //导入依赖的package包/类
public void setSize(final int size) {
if (size <= 0) {
throw new IllegalArgumentException("size must be greater than zero");
}
this.size = size;
if (theDots != null) {
theDots.clear();
removeAllViews();
} else {
theDots = new ArrayList<>();
}
for (int i = 0; i < this.size; i++) {
IconicsImageView iv = new IconicsImageView(getContext());
iv.setImageDrawable(unmarkedIcon);
theDots.add(iv);
addView(iv);
}
}
示例6: updateIcon
import com.mikepenz.iconics.view.IconicsImageView; //导入依赖的package包/类
@Override
public void updateIcon(BaseSetting<Value, CLASS, SettData, VH> data, boolean globalSetting) {
IIcon icon = data.getIcon();
if (icon != null) {
getIconView().setVisibility(View.VISIBLE);
IconicsImageView iv = (IconicsImageView) getIconView();
IconicsDrawable drawable = new IconicsDrawable(iv.getContext(), icon);
drawable.paddingDp(data.getIconPaddingDp());
if (data.getIconColor() != null) {
drawable.color(data.getIconColor());
} else {
drawable.color(Util.getTextColor());
}
iv.setIcon(drawable);
// IconicsDrawable d = ((IconicsDrawable) getIconView().getDrawable());
// d.icon(icon).color(Util.getTextColor()).paddingDp(data.getIconPaddingDp());
} else {
getIconView().setVisibility(View.GONE);
}
if (!globalSetting) {
int dividerMarginLeft = (int) getInnerDivider().getContext().getResources().getDimension(icon == null ? R.dimen.divider_left_margin_no_image : R.dimen.divider_left_margin_with_image);
int row2PaddingLeft = (int) getInnerDivider().getContext().getResources().getDimension(icon == null ? R.dimen.row2_left_padding_no_image : R.dimen.row2_left_padding_with_image);
((ViewGroup.MarginLayoutParams) getInnerDivider().getLayoutParams()).leftMargin = dividerMarginLeft;
getRow2().setPadding(row2PaddingLeft, getRow2().getPaddingTop(), getRow2().getPaddingRight(), getRow2().getPaddingBottom());
}
}
示例7: onCreate
import com.mikepenz.iconics.view.IconicsImageView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
// set Theme before anything else in onCreate();
// applyTheme(); // not yet ready, missing theme definitions for dialogs
// apply forced locale (if set in developer options)
applyLocale();
super.onCreate(savedInstanceState);
setContentView(R.layout.dialog_write_nfc_tag);
setFinishOnTouchOutside(false); // prevent close dialog on touch outside window
setTitle(R.string.write_nfc_tag);
Intent intent = getIntent();
if (intent.hasExtra(KEY_CONTENT)) {
content = intent.getStringExtra(KEY_CONTENT);
}
nfcAdapter = NfcAdapter.getDefaultAdapter(this);
textViewStatus = (TextView) findViewById(R.id.txt_nfc_status);
textViewStatus.setText(R.string.waiting_for_tag);
layoutLoading = (LinearLayout) findViewById(R.id.layoutLoading);
successImage = (IconicsImageView) findViewById(R.id.imageView_success);
errorImage = (IconicsImageView) findViewById(R.id.imageView_error);
}
示例8: ViewHolder
import com.mikepenz.iconics.view.IconicsImageView; //导入依赖的package包/类
public ViewHolder(View itemView) {
super(itemView);
this.ssid = (TextView) itemView.findViewById(R.id.txt_ssid);
this.delete = (IconicsImageView) itemView.findViewById(R.id.delete);
this.footer = (LinearLayout) itemView.findViewById(R.id.list_footer);
this.delete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (onDeleteClickListener != null) {
onDeleteClickListener.onItemClick(delete, getLayoutPosition());
}
}
});
}
示例9: ViewHolder
import com.mikepenz.iconics.view.IconicsImageView; //导入依赖的package包/类
public ViewHolder(View itemView) {
super(itemView);
this.description = (TextView) itemView.findViewById(R.id.txt_action_description);
this.delete = (IconicsImageView) itemView.findViewById(R.id.delete);
this.footer = (LinearLayout) itemView.findViewById(R.id.list_footer);
this.delete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (onDeleteClickListener != null) {
onDeleteClickListener.onItemClick(delete, getLayoutPosition());
}
}
});
}
示例10: ViewHolder
import com.mikepenz.iconics.view.IconicsImageView; //导入依赖的package包/类
public ViewHolder(View itemView) {
super(itemView);
this.phoneNumber = (TextView) itemView.findViewById(R.id.txt_phoneNumber);
this.delete = (IconicsImageView) itemView.findViewById(R.id.delete);
this.footer = (LinearLayout) itemView.findViewById(R.id.list_footer);
this.delete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (onDeleteClickListener != null) {
onDeleteClickListener.onItemClick(delete, getLayoutPosition());
}
}
});
}
示例11: error
import com.mikepenz.iconics.view.IconicsImageView; //导入依赖的package包/类
public void error() {
for (int i = 0; i < size; i++) {
final IconicsImageView currentDot = theDots.get(i);
currentDot.setIcon(errorIcon);
}
this.startAnimation(shakeAnim);
}
示例12: isPolicyRespected
import com.mikepenz.iconics.view.IconicsImageView; //导入依赖的package包/类
@Override
public boolean isPolicyRespected() {
TextView textView = (TextView) getView().findViewById(R.id.disableLockTxtBt);
IconicsImageView imageView = (IconicsImageView) getView().findViewById(R.id.intro_disableSLImage);
KeyguardManager keyguardManager = (KeyguardManager) getContext().getSystemService(KEYGUARD_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
if (!keyguardManager.isKeyguardSecure()) {
AppLogger.info("Lockscreen is turned off!");
textView.setText(R.string.disableSLBTLockDisabled);
textView.setClickable(false);
imageView.setImageDrawable(new IconicsDrawable(getActivity()).icon(GoogleMaterial.Icon.gmd_check_circle));
return true;
} else {
AppLogger.info("Lockscreen is turned on!");
if (forceEnabledSystemLockScreen == true) {
AppLogger.info("User wants to keep system lock on!");
textView.setText(R.string.disableSLBTLockForced);
textView.setClickable(false);
imageView.setIcon(new IconicsDrawable(getActivity()).icon(GoogleMaterial.Icon.gmd_check_circle));
return true;
} else {
return false;
}
}
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (!keyguardManager.isDeviceSecure()) {
AppLogger.info("Lockscreen is turned off!");
textView.setText(R.string.disableSLBTLockDisabled);
textView.setClickable(false);
imageView.setImageDrawable(new IconicsDrawable(getActivity()).icon(GoogleMaterial.Icon.gmd_check_circle));
return true;
} else {
AppLogger.info("Lockscreen is turned on!");
if (forceEnabledSystemLockScreen == true) {
AppLogger.info("User wants to keep system lock on!");
textView.setText(R.string.disableSLBTLockForced);
textView.setClickable(false);
imageView.setIcon(new IconicsDrawable(getActivity()).icon(GoogleMaterial.Icon.gmd_check_circle));
return true;
} else {
return false;
}
}
}
AppLogger.info("Lockscreen is turned on!");
return false;
}
示例13: ViewHolder
import com.mikepenz.iconics.view.IconicsImageView; //导入依赖的package包/类
public ViewHolder(View view) {
super(view);
arrow = (IconicsImageView) view.findViewById(R.id.material_drawer_arrow);
arrow.setIcon(new IconicsDrawable(view.getContext(), MaterialDrawerFont.Icon.mdf_expand_more).sizeDp(16).paddingDp(2).color(Color.BLACK));
}
示例14: initHistoryDrawer
import com.mikepenz.iconics.view.IconicsImageView; //导入依赖的package包/类
private void initHistoryDrawer(Drawer navigationDrawer) {
// parent HAS to be null, so it can be attached to navigationDrawer later on
View historyView = LayoutInflater.from(this).inflate(R.layout.drawer_history, null, false);
IconicsImageView clearHistory = (IconicsImageView) historyView.findViewById(R.id.buttonClear);
clearHistory.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new AsyncTask<Void, Void, Exception>() {
@Override
protected Exception doInBackground(Void... params) {
try {
DatabaseHandler.clearHistory();
} catch (Exception e) {
return e;
}
return null;
}
@Override
protected void onPostExecute(Exception exception) {
updateHistory();
if (exception != null) {
StatusMessageHandler.showErrorMessage(getActivity(), exception);
}
}
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
});
layoutLoadingHistory = (LinearLayout) historyView.findViewById(R.id.layoutLoading);
recyclerViewHistory = (RecyclerView) historyView.findViewById(R.id.recyclerview_history);
historyItemArrayAdapter = new HistoryItemRecyclerViewAdapter(this, historyItems);
historyItemArrayAdapter.setOnItemClickListener(new HistoryItemRecyclerViewAdapter.OnItemClickListener() {
@Override
public void onItemClick(View itemView, int position) {
HistoryItem historyItem = historyItems.get(position);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd.MM.yyyy - HH:mm:ss");
new AlertDialog.Builder(getActivity())
.setTitle(R.string.details)
.setMessage(simpleDateFormat.format(historyItem.getTime().getTime()) + "\n\n" +
historyItem.getShortDescription() + "\n\n" +
historyItem.getLongDescription())
.setNeutralButton(R.string.close, null)
.show();
}
});
recyclerViewHistory.setAdapter(historyItemArrayAdapter);
StaggeredGridLayoutManager layoutManager = new StaggeredGridLayoutManager(1, StaggeredGridLayoutManager.VERTICAL);
recyclerViewHistory.setLayoutManager(layoutManager);
historyDrawer = new DrawerBuilder()
.withActivity(this)
.withCustomView(historyView)
.withHeaderPadding(true)
.withDrawerGravity(Gravity.END)
.append(navigationDrawer);
}
示例15: unmarkCurrent
import com.mikepenz.iconics.view.IconicsImageView; //导入依赖的package包/类
private void unmarkCurrent() {
final IconicsImageView currentDot = theDots.get(index);
currentDot.setIcon(unmarkedIcon);
}