This repository has been archived by the owner on Dec 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 485
/
SupportPresenter.java
61 lines (49 loc) · 1.78 KB
/
SupportPresenter.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.simplecity.amp_library.ui.settings;
import android.content.Intent;
import android.net.Uri;
import android.support.annotation.NonNull;
import com.simplecity.amp_library.BuildConfig;
import com.simplecity.amp_library.ShuttleApplication;
import com.simplecity.amp_library.ui.presenters.Presenter;
import com.simplecity.amp_library.utils.SettingsManager;
import com.simplecity.amp_library.utils.ShuttleUtils;
import javax.inject.Inject;
public class SupportPresenter extends Presenter<SupportView> {
@Inject
public SupportPresenter() {
}
@Override
public void bindView(@NonNull SupportView view) {
super.bindView(view);
setAppVersion();
}
private void setAppVersion() {
SupportView supportView = getView();
if (supportView != null) {
supportView.setVersion("Shuttle Music Player " + BuildConfig.VERSION_NAME);
}
}
public void faqClicked() {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("http://www.shuttlemusicplayer.com/#faq"));
SupportView supportView = getView();
if (supportView != null) {
supportView.showFaq(intent);
}
}
public void helpClicked() {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://discord.gg/4Z5EU7K"));
SupportView supportView = getView();
if (supportView != null) {
supportView.showHelp(intent);
}
}
public void rateClicked() {
SettingsManager.getInstance().setHasRated();
SupportView supportView = getView();
if (supportView != null) {
Intent intent = ShuttleUtils.getShuttleStoreIntent(ShuttleApplication.getInstance().getPackageName());
supportView.showRate(intent);
}
}
}