use of androidx.appcompat.app.AppCompatActivity in project Timber by naman14.
the class Timber5 method setupSlidingQueue.
private void setupSlidingQueue() {
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false));
adapter = new SlidingQueueAdapter((AppCompatActivity) getActivity(), QueueLoader.getQueueSongs(getActivity()));
recyclerView.setAdapter(adapter);
recyclerView.scrollToPosition(MusicPlayer.getQueuePosition() - 3);
}
use of androidx.appcompat.app.AppCompatActivity in project Timber by naman14.
the class ArtistDetailFragment method setupToolbar.
private void setupToolbar() {
((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
final ActionBar ab = ((AppCompatActivity) getActivity()).getSupportActionBar();
ab.setDisplayShowTitleEnabled(false);
ab.setDisplayHomeAsUpEnabled(true);
}
use of androidx.appcompat.app.AppCompatActivity in project Timber by naman14.
the class MainFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
Toolbar toolbar = (Toolbar) rootView.findViewById(R.id.toolbar);
((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
final ActionBar ab = ((AppCompatActivity) getActivity()).getSupportActionBar();
ab.setHomeAsUpIndicator(R.drawable.ic_menu);
ab.setDisplayHomeAsUpEnabled(true);
viewPager = (ViewPager) rootView.findViewById(R.id.viewpager);
if (viewPager != null) {
setupViewPager(viewPager);
viewPager.setOffscreenPageLimit(2);
}
TabLayout tabLayout = (TabLayout) rootView.findViewById(R.id.tabs);
tabLayout.setupWithViewPager(viewPager);
return rootView;
}
use of androidx.appcompat.app.AppCompatActivity in project Timber by naman14.
the class NavigationUtils method navigateToArtist.
@TargetApi(21)
public static void navigateToArtist(Activity context, long artistID, Pair<View, String> transitionViews) {
FragmentTransaction transaction = ((AppCompatActivity) context).getSupportFragmentManager().beginTransaction();
Fragment fragment;
transaction.setCustomAnimations(R.anim.activity_fade_in, R.anim.activity_fade_out, R.anim.activity_fade_in, R.anim.activity_fade_out);
fragment = ArtistDetailFragment.newInstance(artistID, false, null);
transaction.hide(((AppCompatActivity) context).getSupportFragmentManager().findFragmentById(R.id.fragment_container));
transaction.add(R.id.fragment_container, fragment);
transaction.addToBackStack(null).commit();
}
use of androidx.appcompat.app.AppCompatActivity in project ETSMobile-Android2 by ApplETS.
the class BandwidthFragment method updateProgressBarColorItems.
private void updateProgressBarColorItems(double bandwidthQuota) {
final int[] colorChoice = new int[] { R.color.red_bandwith, R.color.blue_bandwith, R.color.green_bandwith, R.color.purple_bandwith };
int[] legendColors = new int[values.length];
final AppCompatActivity activity = (AppCompatActivity) getActivity();
progressBar.clearProgressItems();
bandwidthQuota = bandwidthQuota / 1024;
for (int i = 0, color = 0; i < values.length - 1; ++i) {
ProgressItem progressItem = new ProgressItem(colorChoice[color], (values[i] / bandwidthQuota) * 100);
progressBar.addProgressItem(progressItem);
legendColors[i] = colorChoice[color];
color++;
if (color == colorChoice.length)
color = 0;
}
if (values.length > 0) {
int lastValue = values.length - 1;
ProgressItem progressItem = new ProgressItem(R.color.grey_bandwith, (values[lastValue] / bandwidthQuota) * 100);
legendColors[lastValue] = R.color.grey_bandwith;
progressBar.addProgressItem(progressItem);
}
/*if (activity != null) {
final int[] colors = legendColors;
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
grid.setAdapter(new LegendAdapter(activity, rooms, colors));
}
});
}*/
}
Aggregations