Error handling added

This commit is contained in:
hemanths@live.com 2018-12-26 23:01:39 +05:30
parent a773074c77
commit 8dfb0dc8dd
50 changed files with 2206 additions and 1473 deletions

View file

@ -24,13 +24,13 @@ public class BottomNavigationBarTinted extends BottomNavigationView {
public BottomNavigationBarTinted(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
setLabelVisibilityMode(PreferenceUtil.getInstance().getTabTitleMode());
setBackgroundColor(ThemeStore.primaryColor(context));
setBackgroundColor(ThemeStore.Companion.primaryColor(context));
setSelectedItemId(PreferenceUtil.getInstance().getLastPage());
int iconColor = ATHUtil.resolveColor(context, R.attr.iconColor);
int accentColor = ThemeStore.accentColor(context);
NavigationViewUtil.setItemIconColors(this, ColorUtil.withAlpha(iconColor, 0.5f), accentColor);
NavigationViewUtil.setItemTextColors(this, ColorUtil.withAlpha(iconColor, 0.5f), accentColor);
int iconColor = ATHUtil.INSTANCE.resolveColor(context, R.attr.iconColor);
int accentColor = ThemeStore.Companion.accentColor(context);
NavigationViewUtil.INSTANCE.setItemIconColors(this, ColorUtil.INSTANCE.withAlpha(iconColor, 0.5f), accentColor);
NavigationViewUtil.INSTANCE.setItemTextColors(this, ColorUtil.INSTANCE.withAlpha(iconColor, 0.5f), accentColor);
}
}

View file

@ -135,8 +135,8 @@ public class BreadCrumbLayout extends HorizontalScrollView implements View.OnCli
private SelectionCallback mCallback;
private void init() {
contentColorActivated = ThemeStore.textColorPrimary(getContext());
contentColorDeactivated = ThemeStore.textColorSecondary(getContext());
contentColorActivated = ThemeStore.Companion.textColorPrimary(getContext());
contentColorDeactivated = ThemeStore.Companion.textColorSecondary(getContext());
setMinimumHeight((int) getResources().getDimension(R.dimen.tab_height));
setClipToPadding(false);
setHorizontalScrollBarEnabled(false);

View file

@ -72,7 +72,7 @@ public class CollapsingFAB extends FrameLayout {
public void setColor(int color) {
this.color = color;
int textColor = MaterialValueHelper.getPrimaryTextColor(getContext(), ColorUtil.isColorLight(color));
int textColor = MaterialValueHelper.INSTANCE.getPrimaryTextColor(getContext(), ColorUtil.INSTANCE.isColorLight(color));
shuffleIcon.setColorFilter(textColor);
textView.setTextColor(textColor);
cardView.setCardBackgroundColor(ColorStateList.valueOf(color));

View file

@ -27,6 +27,6 @@ public class IconImageView extends androidx.appcompat.widget.AppCompatImageView
private void init(Context context) {
if (context == null) return;
setColorFilter(ATHUtil.resolveColor(context, R.attr.iconColor), PorterDuff.Mode.SRC_IN);
setColorFilter(ATHUtil.INSTANCE.resolveColor(context, R.attr.iconColor), PorterDuff.Mode.SRC_IN);
}
}

View file

@ -42,12 +42,12 @@ public class RoundedBottomSheetDialogFragment extends AppCompatDialogFragment {
if (bottomSheet != null) {
BottomSheetBehavior behavior = BottomSheetBehavior.from(bottomSheet);
behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
bottomSheet.setBackground(RetroUtil.getTintedDrawable(getContext(), R.drawable.bg_bottom_sheet_dialog_fragment, ThemeStore.primaryColor(getContext())));
bottomSheet.setBackground(RetroUtil.getTintedDrawable(getContext(), R.drawable.bg_bottom_sheet_dialog_fragment, ThemeStore.Companion.primaryColor(getContext())));
}
});
if (getActivity() != null) {
if (VersionUtils.hasNougat()) {
((AbsBaseActivity) getActivity()).setNavigationbarColor(ThemeStore.primaryColor(getContext()));
if (VersionUtils.INSTANCE.hasNougat()) {
((AbsBaseActivity) getActivity()).setNavigationbarColor(ThemeStore.Companion.primaryColor(getContext()));
} else {
((AbsBaseActivity) getActivity()).setNavigationbarColorAuto();
}
@ -67,7 +67,7 @@ public class RoundedBottomSheetDialogFragment extends AppCompatDialogFragment {
if (getDialog() != null && getDialog().getWindow() != null) {
Window window = getDialog().getWindow();
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
window.setNavigationBarColor(ThemeStore.primaryColor(getContext()));
window.setNavigationBarColor(ThemeStore.Companion.primaryColor(getContext()));
window.findViewById(com.google.android.material.R.id.container).setFitsSystemWindows(true);
}
}