Search in sources :

Example 1 with AppCompatActivity

use of androidx.appcompat.app.AppCompatActivity in project WordPress-Login-Flow-Android by wordpress-mobile.

the class LoginMagicLinkRequestFragment method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    Toolbar toolbar = view.findViewById(R.id.toolbar);
    ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
    ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
    if (actionBar != null) {
        actionBar.setTitle(R.string.log_in);
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
    if (savedInstanceState == null) {
        mAnalyticsListener.trackMagicLinkRequestFormViewed();
    }
    if (mForceRequestAtStart && !mInProgress) {
        dispatchMagicLinkRequest();
    }
}
Also used : AppCompatActivity(androidx.appcompat.app.AppCompatActivity) ActionBar(androidx.appcompat.app.ActionBar) Toolbar(androidx.appcompat.widget.Toolbar)

Example 2 with AppCompatActivity

use of androidx.appcompat.app.AppCompatActivity in project WordPress-Login-Flow-Android by wordpress-mobile.

the class LoginMagicLinkSentFragment method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    Toolbar toolbar = view.findViewById(R.id.toolbar);
    ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
    ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
    if (actionBar != null) {
        actionBar.setTitle(R.string.log_in);
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
    if (savedInstanceState == null) {
        mAnalyticsListener.trackLoginMagicLinkOpenEmailClientViewed();
    }
}
Also used : AppCompatActivity(androidx.appcompat.app.AppCompatActivity) ActionBar(androidx.appcompat.app.ActionBar) Toolbar(androidx.appcompat.widget.Toolbar)

Example 3 with AppCompatActivity

use of androidx.appcompat.app.AppCompatActivity in project Timber by naman14.

the class LyricsFragment method setupToolbar.

private void setupToolbar() {
    ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
    final ActionBar ab = ((AppCompatActivity) getActivity()).getSupportActionBar();
    ab.setDisplayHomeAsUpEnabled(true);
    if (MusicPlayer.getTrackName() != null) {
        ab.setTitle(MusicPlayer.getTrackName());
    }
}
Also used : AppCompatActivity(androidx.appcompat.app.AppCompatActivity) ActionBar(androidx.appcompat.app.ActionBar)

Example 4 with AppCompatActivity

use of androidx.appcompat.app.AppCompatActivity in project Timber by naman14.

the class PlaylistFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_playlist, container, false);
    Toolbar toolbar = (Toolbar) rootView.findViewById(R.id.toolbar);
    pager = (MultiViewPager) rootView.findViewById(R.id.playlistpager);
    recyclerView = (RecyclerView) rootView.findViewById(R.id.recyclerview);
    ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
    final ActionBar ab = ((AppCompatActivity) getActivity()).getSupportActionBar();
    ab.setHomeAsUpIndicator(R.drawable.ic_menu);
    ab.setDisplayHomeAsUpEnabled(true);
    ab.setTitle(R.string.playlists);
    playlists = PlaylistLoader.getPlaylists(getActivity(), showAuto);
    playlistcount = playlists.size();
    if (isDefault) {
        initPager();
    } else {
        initRecyclerView();
    }
    return rootView;
}
Also used : AppCompatActivity(androidx.appcompat.app.AppCompatActivity) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) ActionBar(androidx.appcompat.app.ActionBar) Toolbar(androidx.appcompat.widget.Toolbar)

Example 5 with AppCompatActivity

use of androidx.appcompat.app.AppCompatActivity in project Timber by naman14.

the class BaseNowplayingFragment method setSongDetails.

public void setSongDetails(View view) {
    albumart = (ImageView) view.findViewById(R.id.album_art);
    shuffle = (ImageView) view.findViewById(R.id.shuffle);
    repeat = (ImageView) view.findViewById(R.id.repeat);
    next = (MaterialIconView) view.findViewById(R.id.next);
    previous = (MaterialIconView) view.findViewById(R.id.previous);
    mPlayPause = (PlayPauseButton) view.findViewById(R.id.playpause);
    playPauseFloating = (FloatingActionButton) view.findViewById(R.id.playpausefloating);
    playPauseWrapper = view.findViewById(R.id.playpausewrapper);
    songtitle = (TextView) view.findViewById(R.id.song_title);
    songalbum = (TextView) view.findViewById(R.id.song_album);
    songartist = (TextView) view.findViewById(R.id.song_artist);
    songduration = (TextView) view.findViewById(R.id.song_duration);
    elapsedtime = (TextView) view.findViewById(R.id.song_elapsed_time);
    timelyView11 = (TimelyView) view.findViewById(R.id.timelyView11);
    timelyView12 = (TimelyView) view.findViewById(R.id.timelyView12);
    timelyView13 = (TimelyView) view.findViewById(R.id.timelyView13);
    timelyView14 = (TimelyView) view.findViewById(R.id.timelyView14);
    timelyView15 = (TimelyView) view.findViewById(R.id.timelyView15);
    hourColon = (TextView) view.findViewById(R.id.hour_colon);
    mProgress = (SeekBar) view.findViewById(R.id.song_progress);
    mCircularProgress = (CircularSeekBar) view.findViewById(R.id.song_progress_circular);
    recyclerView = (RecyclerView) view.findViewById(R.id.queue_recyclerview);
    songtitle.setSelected(true);
    Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
    if (toolbar != null) {
        ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
        final ActionBar ab = ((AppCompatActivity) getActivity()).getSupportActionBar();
        ab.setDisplayHomeAsUpEnabled(true);
        ab.setTitle("");
    }
    if (mPlayPause != null && getActivity() != null) {
        mPlayPause.setColor(ContextCompat.getColor(getContext(), android.R.color.white));
    }
    if (playPauseFloating != null) {
        playPauseDrawable.setColorFilter(TimberUtils.getBlackWhiteColor(accentColor), PorterDuff.Mode.MULTIPLY);
        playPauseFloating.setImageDrawable(playPauseDrawable);
        if (MusicPlayer.isPlaying())
            playPauseDrawable.transformToPause(false);
        else
            playPauseDrawable.transformToPlay(false);
    }
    if (mCircularProgress != null) {
        mCircularProgress.setCircleProgressColor(accentColor);
        mCircularProgress.setPointerColor(accentColor);
        mCircularProgress.setPointerHaloColor(accentColor);
    }
    if (timelyView11 != null) {
        String time = TimberUtils.makeShortTimeString(getActivity(), MusicPlayer.position() / 1000);
        if (time.length() < 5) {
            timelyView11.setVisibility(View.GONE);
            timelyView12.setVisibility(View.GONE);
            hourColon.setVisibility(View.GONE);
            changeDigit(timelyView13, time.charAt(0) - '0');
            changeDigit(timelyView14, time.charAt(2) - '0');
            changeDigit(timelyView15, time.charAt(3) - '0');
        } else if (time.length() == 5) {
            timelyView12.setVisibility(View.VISIBLE);
            changeDigit(timelyView12, time.charAt(0) - '0');
            changeDigit(timelyView13, time.charAt(1) - '0');
            changeDigit(timelyView14, time.charAt(3) - '0');
            changeDigit(timelyView15, time.charAt(4) - '0');
        } else {
            timelyView11.setVisibility(View.VISIBLE);
            hourColon.setVisibility(View.VISIBLE);
            changeDigit(timelyView11, time.charAt(0) - '0');
            changeDigit(timelyView12, time.charAt(2) - '0');
            changeDigit(timelyView13, time.charAt(3) - '0');
            changeDigit(timelyView14, time.charAt(5) - '0');
            changeDigit(timelyView15, time.charAt(6) - '0');
        }
    }
    setSongDetails();
}
Also used : AppCompatActivity(androidx.appcompat.app.AppCompatActivity) ActionBar(androidx.appcompat.app.ActionBar) Toolbar(androidx.appcompat.widget.Toolbar)

Aggregations

AppCompatActivity (androidx.appcompat.app.AppCompatActivity)71 ActionBar (androidx.appcompat.app.ActionBar)21 Toolbar (androidx.appcompat.widget.Toolbar)19 View (android.view.View)18 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)10 RecyclerView (androidx.recyclerview.widget.RecyclerView)7 Intent (android.content.Intent)6 TextView (android.widget.TextView)6 Fragment (androidx.fragment.app.Fragment)6 Activity (android.app.Activity)5 Bundle (android.os.Bundle)5 BindView (butterknife.BindView)5 LayoutInflater (android.view.LayoutInflater)4 ImageView (android.widget.ImageView)4 ScrollView (android.widget.ScrollView)4 List (java.util.List)4 MenuItem (android.view.MenuItem)3 Nullable (androidx.annotation.Nullable)3 TargetApi (android.annotation.TargetApi)2 Dialog (android.app.Dialog)2