Search in sources :

Example 1 with WriteSettingsPermissionActivityHelper

use of com.frostwire.android.gui.util.WriteSettingsPermissionActivityHelper in project frostwire by frostwire.

the class AudioPlayerActivity method onCreate.

@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // Control the media volume
    setVolumeControlStream(AudioManager.STREAM_MUSIC);
    // Bind Apollo's service
    mToken = MusicUtils.bindToService(this, this);
    // Initialize the image fetcher/cache
    mImageFetcher = ApolloUtils.getImageFetcher(this);
    // Initialize the handler used to update the current time
    mTimeHandler = new TimeHandler(this);
    // Initialize the broadcast receiver
    mPlaybackStatus = new PlaybackStatus(this);
    // Cache all the items
    initPlaybackControls();
    // Album Art Ad Controls
    mMopubAd = findView(R.id.audio_player_mopubview);
    mFallbackAd = findView(R.id.audio_player_fallback_imageview);
    mDismissAlbumArtAdButton = findView(R.id.audio_player_dismiss_mopubview_button);
    mAdvertisementText = findView(R.id.audio_player_advertisement_text);
    removeAdsTextView = findView(R.id.audio_player_remove_ads_text_link);
    initAlbumArtBanner();
    initRemoveAds();
    mPlayPauseButton.setOnLongClickListener(new StopListener(this, true));
    PlayerGestureListener gestureListener = new PlayerGestureListener();
    gestureDetector = new GestureDetector(this, gestureListener);
    gestureDetector.setOnDoubleTapListener(gestureListener);
    mAlbumArt.setOnTouchListener(gestureListener);
    writeSettingsHelper = new WriteSettingsPermissionActivityHelper(this);
}
Also used : WriteSettingsPermissionActivityHelper(com.frostwire.android.gui.util.WriteSettingsPermissionActivityHelper) GestureDetector(android.view.GestureDetector)

Example 2 with WriteSettingsPermissionActivityHelper

use of com.frostwire.android.gui.util.WriteSettingsPermissionActivityHelper in project frostwire by frostwire.

the class SetAsRingtoneMenuAction method onClick.

@Override
public void onClick(Context context) {
    if (DangerousPermissionsChecker.hasPermissionToWriteSettings(context)) {
        MusicUtils.setRingtone(context, fd.id, fd.fileType);
    } else {
        WriteSettingsPermissionActivityHelper helper = new WriteSettingsPermissionActivityHelper((Activity) context);
        helper.onSetRingtoneOption((Activity) context, fd.id, fd.fileType);
    }
}
Also used : WriteSettingsPermissionActivityHelper(com.frostwire.android.gui.util.WriteSettingsPermissionActivityHelper)

Example 3 with WriteSettingsPermissionActivityHelper

use of com.frostwire.android.gui.util.WriteSettingsPermissionActivityHelper in project frostwire by frostwire.

the class ApolloFragment method onUseAsRingtone.

private boolean onUseAsRingtone() {
    Activity activity = getActivity();
    if (activity == null) {
        return false;
    }
    if (mSelectedId == -1) {
        return false;
    }
    WriteSettingsPermissionActivityHelper helper = new WriteSettingsPermissionActivityHelper(getActivity());
    helper.onSetRingtoneOption(getActivity(), mSelectedId, Constants.FILE_TYPE_AUDIO);
    return true;
}
Also used : WriteSettingsPermissionActivityHelper(com.frostwire.android.gui.util.WriteSettingsPermissionActivityHelper) BaseActivity(com.andrew.apollo.ui.activities.BaseActivity) Activity(android.app.Activity)

Aggregations

WriteSettingsPermissionActivityHelper (com.frostwire.android.gui.util.WriteSettingsPermissionActivityHelper)3 Activity (android.app.Activity)1 GestureDetector (android.view.GestureDetector)1 BaseActivity (com.andrew.apollo.ui.activities.BaseActivity)1