use of androidx.appcompat.app.AppCompatActivity in project Timber by naman14.
the class QueueFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_queue, container, false);
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);
ab.setTitle(R.string.playing_queue);
recyclerView = rootView.findViewById(R.id.recyclerview);
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
recyclerView.setItemAnimator(null);
recyclerView.setEmptyView(getActivity(), rootView.findViewById(R.id.list_empty), "No songs in queue");
new loadQueueSongs().execute("");
((BaseActivity) getActivity()).setMusicStateListenerListener(this);
return rootView;
}
use of androidx.appcompat.app.AppCompatActivity in project Timber by naman14.
the class AlbumDetailFragment method setupToolbar.
private void setupToolbar() {
((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
final ActionBar ab = ((AppCompatActivity) getActivity()).getSupportActionBar();
ab.setDisplayHomeAsUpEnabled(true);
collapsingToolbarLayout.setTitle(album.title);
}
use of androidx.appcompat.app.AppCompatActivity in project Timber by naman14.
the class NavigationUtils method navigateToAlbum.
@TargetApi(21)
public static void navigateToAlbum(Activity context, long albumID, 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 = AlbumDetailFragment.newInstance(albumID, 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 OneSignal-Android-SDK by OneSignal.
the class OSSystemConditionController method isDialogFragmentShowing.
boolean isDialogFragmentShowing(Context context) throws NoClassDefFoundError {
// Detect if user has a dialog fragment showing
if (context instanceof AppCompatActivity) {
final FragmentManager manager = ((AppCompatActivity) context).getSupportFragmentManager();
manager.registerFragmentLifecycleCallbacks(new FragmentManager.FragmentLifecycleCallbacks() {
@Override
public void onFragmentDetached(@NonNull FragmentManager fm, @NonNull Fragment fragmentDetached) {
super.onFragmentDetached(fm, fragmentDetached);
if (fragmentDetached instanceof DialogFragment) {
manager.unregisterFragmentLifecycleCallbacks(this);
systemConditionObserver.systemConditionChanged();
}
}
}, true);
List<Fragment> fragments = manager.getFragments();
int size = fragments.size();
if (size > 0) {
// We only care of the last fragment available
Fragment fragment = fragments.get(size - 1);
return fragment.isVisible() && fragment instanceof DialogFragment;
}
}
// We cannot detect AlertDialogs because they are added to the decor view as linear layout without an identification
return false;
}
use of androidx.appcompat.app.AppCompatActivity in project Signal-Android by signalapp.
the class MediaOverviewPageFragment method onActivityCreated.
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
voiceNoteMediaController = new VoiceNoteMediaController((AppCompatActivity) requireActivity());
}
Aggregations