use of net.steamcrafted.materialiconlib.MaterialIconView in project CoCoin by Nightonke.
the class AccountBookTodayViewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_account_book_today_view);
SuperToast.cancelAllSuperToasts();
mContext = this;
mViewPager = (MaterialViewPager) findViewById(R.id.materialViewPager);
userName = (TextView) findViewById(R.id.user_name);
userEmail = (TextView) findViewById(R.id.user_email);
userName.setTypeface(CoCoinUtil.typefaceLatoRegular);
userEmail.setTypeface(CoCoinUtil.typefaceLatoLight);
User user = BmobUser.getCurrentUser(CoCoinApplication.getAppContext(), User.class);
if (user != null) {
userName.setText(user.getUsername());
userEmail.setText(user.getEmail());
}
setFonts();
View view = mViewPager.getRootView();
title = (TextView) view.findViewById(R.id.logo_white);
title.setTypeface(CoCoinUtil.typefaceLatoLight);
title.setText(SettingManager.getInstance().getAccountBookName());
mViewPager.getPagerTitleStrip().setTypeface(CoCoinUtil.GetTypeface(), Typeface.NORMAL);
setTitle("");
toolbar = mViewPager.getToolbar();
mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout);
custom = (MaterialRippleLayout) mDrawer.findViewById(R.id.custom_layout);
tags = (MaterialRippleLayout) mDrawer.findViewById(R.id.tag_layout);
months = (MaterialRippleLayout) mDrawer.findViewById(R.id.month_layout);
list = (MaterialRippleLayout) mDrawer.findViewById(R.id.list_layout);
report = (MaterialRippleLayout) mDrawer.findViewById(R.id.report_layout);
sync = (MaterialRippleLayout) mDrawer.findViewById(R.id.sync_layout);
settings = (MaterialRippleLayout) mDrawer.findViewById(R.id.settings_layout);
help = (MaterialRippleLayout) mDrawer.findViewById(R.id.help_layout);
feedback = (MaterialRippleLayout) mDrawer.findViewById(R.id.feedback_layout);
about = (MaterialRippleLayout) mDrawer.findViewById(R.id.about_layout);
syncIcon = (MaterialIconView) mDrawer.findViewById(R.id.sync_icon);
setIconEnable(syncIcon, SettingManager.getInstance().getLoggenOn());
monthExpenseTip = (TextView) mDrawer.findViewById(R.id.month_expense_tip);
monthExpenseTip.setTypeface(CoCoinUtil.GetTypeface());
monthExpense = (RiseNumberTextView) mDrawer.findViewById(R.id.month_expense);
monthExpense.setTypeface(CoCoinUtil.typefaceLatoLight);
if (SettingManager.getInstance().getIsMonthLimit()) {
monthExpenseTip.setVisibility(View.VISIBLE);
monthExpense.setText("0");
} else {
monthExpenseTip.setVisibility(View.INVISIBLE);
monthExpense.setVisibility(View.INVISIBLE);
}
if (toolbar != null) {
setSupportActionBar(toolbar);
final ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowHomeEnabled(true);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setHomeButtonEnabled(true);
}
}
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawer, 0, 0) {
public void onDrawerClosed(View view) {
super.onDrawerClosed(view);
monthExpense.setText("0");
}
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
monthExpense.withNumber(RecordManager.getCurrentMonthExpense()).setDuration(500).start();
}
};
mDrawer.setDrawerListener(mDrawerToggle);
View logo = findViewById(R.id.logo_white);
if (logo != null) {
logo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mViewPager.notifyHeaderChanged();
}
});
}
todayModeAdapter = new TodayViewFragmentAdapter(getSupportFragmentManager());
mViewPager.getViewPager().setOffscreenPageLimit(todayModeAdapter.getCount());
mViewPager.getViewPager().setAdapter(todayModeAdapter);
mViewPager.getPagerTitleStrip().setViewPager(mViewPager.getViewPager());
mViewPager.setMaterialViewPagerListener(new MaterialViewPager.Listener() {
@Override
public HeaderDesign getHeaderDesign(int page) {
return HeaderDesign.fromColorAndDrawable(CoCoinUtil.GetTagColor(page - 2), CoCoinUtil.GetTagDrawable(-3));
}
});
setListeners();
profileImage = (CircleImageView) mDrawer.findViewById(R.id.profile_image);
profileImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (SettingManager.getInstance().getLoggenOn()) {
CoCoinUtil.showToast(mContext, R.string.change_logo_tip);
} else {
CoCoinUtil.showToast(mContext, R.string.login_tip);
}
}
});
mDemoSlider = (SliderLayout) findViewById(R.id.slider);
HashMap<String, Integer> urls = CoCoinUtil.GetDrawerTopUrl();
for (String name : urls.keySet()) {
CustomSliderView customSliderView = new CustomSliderView(this);
// initialize a SliderLayout
customSliderView.image(urls.get(name)).setScaleType(BaseSliderView.ScaleType.Fit);
mDemoSlider.addSlider(customSliderView);
}
mDemoSlider.setPresetTransformer(SliderLayout.Transformer.ZoomOut);
mDemoSlider.setCustomAnimation(new DescriptionAnimation());
mDemoSlider.setDuration(4000);
mDemoSlider.setCustomIndicator((PagerIndicator) findViewById(R.id.custom_indicator));
loadLogo();
}
use of net.steamcrafted.materialiconlib.MaterialIconView in project CoCoin by Nightonke.
the class EditRecordActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_edit_record);
overridePendingTransition(R.anim.trans_left_in, R.anim.trans_left_out);
mContext = this;
superToast = new SuperToast(this);
Bundle extras = getIntent().getExtras();
if (extras != null) {
position = extras.getInt("POSITION");
CoCoinUtil.editRecordPosition = RecordManager.SELECTED_RECORDS.size() - 1 - position;
} else {
CoCoinUtil.editRecordPosition = -1;
}
int currentapiVersion = android.os.Build.VERSION.SDK_INT;
if (currentapiVersion >= Build.VERSION_CODES.LOLLIPOP) {
// Do something for lollipop and above versions
Window window = this.getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(ContextCompat.getColor(mContext, R.color.statusBarColor));
} else {
// do something for phones running an SDK before lollipop
}
// edit viewpager///////////////////////////////////////////////////////////////////////////////////
editViewPager = (CoCoinScrollableViewPager) findViewById(R.id.edit_pager);
editViewPager.setOverScrollMode(View.OVER_SCROLL_NEVER);
editAdapter = new EditMoneyRemarkFragmentAdapter(getSupportFragmentManager(), CoCoinFragmentManager.EDIT_RECORD_ACTIVITY_FRAGMENT);
editViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
if (position == 1) {
CoCoinFragmentManager.editRecordActivityEditRemarkFragment.editRequestFocus();
} else {
CoCoinFragmentManager.editRecordActivityEditMoneyFragment.editRequestFocus();
}
}
@Override
public void onPageSelected(int position) {
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
editViewPager.setAdapter(editAdapter);
// tag viewpager////////////////////////////////////////////////////////////////////////////////////
tagViewPager = (ViewPager) findViewById(R.id.viewpager);
tagViewPager.setOverScrollMode(View.OVER_SCROLL_NEVER);
if (RecordManager.TAGS.size() % 8 == 0)
tagAdapter = new TagChooseFragmentAdapter(getSupportFragmentManager(), RecordManager.TAGS.size() / 8);
else
tagAdapter = new TagChooseFragmentAdapter(getSupportFragmentManager(), RecordManager.TAGS.size() / 8 + 1);
tagViewPager.setAdapter(tagAdapter);
myGridView = (MyGridView) findViewById(R.id.gridview);
myGridViewAdapter = new ButtonGridViewAdapter(this);
myGridView.setAdapter(myGridViewAdapter);
myGridView.setOnItemClickListener(gridViewClickListener);
myGridView.setOnItemLongClickListener(gridViewLongClickListener);
myGridView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
myGridView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
View lastChild = myGridView.getChildAt(myGridView.getChildCount() - 1);
myGridView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, lastChild.getBottom()));
}
});
back = (MaterialIconView) findViewById(R.id.back);
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
}
use of net.steamcrafted.materialiconlib.MaterialIconView in project Timber by naman14.
the class QuickControlsFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_playback_controls, container, false);
this.rootView = rootView;
mPlayPause = (PlayPauseButton) rootView.findViewById(R.id.play_pause);
mPlayPauseExpanded = (PlayPauseButton) rootView.findViewById(R.id.playpause);
playPauseWrapper = rootView.findViewById(R.id.play_pause_wrapper);
playPauseWrapperExpanded = rootView.findViewById(R.id.playpausewrapper);
playPauseWrapper.setOnClickListener(mPlayPauseListener);
playPauseWrapperExpanded.setOnClickListener(mPlayPauseExpandedListener);
mProgress = (ProgressBar) rootView.findViewById(R.id.song_progress_normal);
mSeekBar = (SeekBar) rootView.findViewById(R.id.song_progress);
mTitle = (TextView) rootView.findViewById(R.id.title);
mArtist = (TextView) rootView.findViewById(R.id.artist);
mTitleExpanded = (TextView) rootView.findViewById(R.id.song_title);
mArtistExpanded = (TextView) rootView.findViewById(R.id.song_artist);
mAlbumArt = (ImageView) rootView.findViewById(R.id.album_art_nowplayingcard);
mBlurredArt = (ImageView) rootView.findViewById(R.id.blurredAlbumart);
next = (MaterialIconView) rootView.findViewById(R.id.next);
previous = (MaterialIconView) rootView.findViewById(R.id.previous);
topContainer = rootView.findViewById(R.id.topContainer);
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) mProgress.getLayoutParams();
mProgress.measure(0, 0);
layoutParams.setMargins(0, -(mProgress.getMeasuredHeight() / 2), 0, 0);
mProgress.setLayoutParams(layoutParams);
mPlayPause.setColor(Config.accentColor(getActivity(), Helpers.getATEKey(getActivity())));
mPlayPauseExpanded.setColor(Color.WHITE);
mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
if (b) {
MusicPlayer.seek((long) i);
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
MusicPlayer.next();
}
}, 200);
}
});
previous.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
MusicPlayer.previous(getActivity(), false);
}
}, 200);
}
});
((BaseActivity) getActivity()).setMusicStateListenerListener(this);
if (PreferencesUtility.getInstance(getActivity()).isGesturesEnabled()) {
new SlideTrackSwitcher() {
@Override
public void onClick() {
NavigationUtils.navigateToNowplaying(getActivity(), false);
}
}.attach(rootView.findViewById(R.id.root_view));
}
return rootView;
}
use of net.steamcrafted.materialiconlib.MaterialIconView in project CoCoin by Nightonke.
the class EditPasswordActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_edit_password);
overridePendingTransition(R.anim.trans_left_in, R.anim.trans_left_out);
mContext = this;
int currentapiVersion = Build.VERSION.SDK_INT;
if (currentapiVersion >= Build.VERSION_CODES.LOLLIPOP) {
// Do something for lollipop and above versions
Window window = this.getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(ContextCompat.getColor(mContext, R.color.statusBarColor));
} else {
// do something for phones running an SDK before lollipop
}
viewPager = (ViewPager) findViewById(R.id.viewpager);
try {
Interpolator sInterpolator = new AccelerateInterpolator();
Field mScroller;
mScroller = ViewPager.class.getDeclaredField("mScroller");
mScroller.setAccessible(true);
FixedSpeedScroller scroller = new FixedSpeedScroller(viewPager.getContext(), sInterpolator);
scroller.setmDuration(1000);
mScroller.set(viewPager, scroller);
} catch (NoSuchFieldException e) {
} catch (IllegalArgumentException e) {
} catch (IllegalAccessException e) {
}
adapter = new PasswordChangeFragmentAdapter(getSupportFragmentManager());
viewPager.setOffscreenPageLimit(3);
viewPager.setScrollBarFadeDuration(1000);
viewPager.setAdapter(adapter);
myGridView = (MyGridView) findViewById(R.id.gridview);
myGridViewAdapter = new PasswordChangeButtonGridViewAdapter(this);
myGridView.setAdapter(myGridViewAdapter);
myGridView.setOnItemClickListener(gridViewClickListener);
myGridView.setOnItemLongClickListener(gridViewLongClickListener);
myGridView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
myGridView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
View lastChild = myGridView.getChildAt(myGridView.getChildCount() - 1);
myGridView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, lastChild.getBottom()));
}
});
back = (MaterialIconView) findViewById(R.id.back);
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
superToast = new SuperToast(this);
title = (TextView) findViewById(R.id.title);
title.setTypeface(CoCoinUtil.typefaceLatoLight);
if (SettingManager.getInstance().getFirstTime()) {
title.setText(mContext.getResources().getString(R.string.app_name));
} else {
title.setText(mContext.getResources().getString(R.string.change_password));
}
}
use of net.steamcrafted.materialiconlib.MaterialIconView in project CoCoin by Nightonke.
the class SetPasswordActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_edit_password);
overridePendingTransition(R.anim.trans_left_in, R.anim.trans_left_out);
mContext = this;
int currentapiVersion = Build.VERSION.SDK_INT;
if (currentapiVersion >= Build.VERSION_CODES.LOLLIPOP) {
// Do something for lollipop and above versions
Window window = this.getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(ContextCompat.getColor(mContext, R.color.statusBarColor));
} else {
// do something for phones running an SDK before lollipop
}
viewPager = (ViewPager) findViewById(R.id.viewpager);
try {
Interpolator sInterpolator = new AccelerateInterpolator();
Field mScroller;
mScroller = ViewPager.class.getDeclaredField("mScroller");
mScroller.setAccessible(true);
FixedSpeedScroller scroller = new FixedSpeedScroller(viewPager.getContext(), sInterpolator);
scroller.setmDuration(1000);
mScroller.set(viewPager, scroller);
} catch (NoSuchFieldException e) {
} catch (IllegalArgumentException e) {
} catch (IllegalAccessException e) {
}
passwordAdapter = new PasswordChangeFragmentAdapter(getSupportFragmentManager());
viewPager.setOffscreenPageLimit(2);
viewPager.setScrollBarFadeDuration(1000);
viewPager.setAdapter(passwordAdapter);
myGridView = (MyGridView) findViewById(R.id.gridview);
myGridViewAdapter = new PasswordChangeButtonGridViewAdapter(this);
myGridView.setAdapter(myGridViewAdapter);
myGridView.setOnItemClickListener(gridViewClickListener);
myGridView.setOnItemLongClickListener(gridViewLongClickListener);
myGridView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
myGridView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
View lastChild = myGridView.getChildAt(myGridView.getChildCount() - 1);
myGridView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, lastChild.getBottom()));
}
});
back = (MaterialIconView) findViewById(R.id.back);
back.setVisibility(View.INVISIBLE);
superToast = new SuperToast(this);
title = (TextView) findViewById(R.id.title);
title.setTypeface(CoCoinUtil.typefaceLatoLight);
if (SettingManager.getInstance().getFirstTime()) {
title.setText(mContext.getResources().getString(R.string.app_name));
} else {
title.setText(mContext.getResources().getString(R.string.change_password));
}
}
Aggregations