22
22
23
23
package io .phonk .gui ;
24
24
25
+ import android .content .Intent ;
26
+ import android .graphics .Color ;
27
+ import android .graphics .PixelFormat ;
28
+ import android .media .MediaPlayer ;
29
+ import android .net .Uri ;
25
30
import android .os .Bundle ;
31
+ import android .preference .ListPreference ;
26
32
import android .view .View ;
27
33
import android .widget .FrameLayout ;
34
+ import android .widget .ImageButton ;
35
+ import android .widget .TextView ;
36
+ import android .widget .VideoView ;
28
37
38
+ import io .phonk .BuildConfig ;
29
39
import io .phonk .R ;
30
40
import io .phonk .gui ._components .APIWebviewFragment ;
31
41
import io .phonk .runner .base .BaseActivity ;
34
44
public class AboutActivity extends BaseActivity {
35
45
36
46
private static final String TAG = AboutActivity .class .getSimpleName ();
47
+ private VideoView videoView ;
37
48
38
49
@ Override
39
50
public void onCreate (Bundle savedInstanceState ) {
40
51
super .onCreate (savedInstanceState );
41
- setContentView (R .layout .help_activity );
52
+ setContentView (R .layout .about_activity );
42
53
43
54
setupActivity ();
44
55
45
- FrameLayout fl = findViewById (R .id .fragmentWebview );
46
- fl .setVisibility (View .VISIBLE );
47
- MLog .d (TAG , "using webide" );
48
- APIWebviewFragment webViewFragment = new APIWebviewFragment ();
49
- Bundle bundle = new Bundle ();
50
- bundle .putString ("url" , "http://127.0.0.1:8585" );
51
- webViewFragment .setArguments (bundle );
56
+ ImageButton btnPatreon = findViewById (R .id .btnPatreon );
57
+ ImageButton btnBuyMeACoffee = findViewById (R .id .btnBuyMeACoffee );
58
+
59
+ btnPatreon .setOnClickListener (view -> openLink ("https://www.patreon.com/victornomad" ));
60
+ btnBuyMeACoffee .setOnClickListener (view -> openLink ("https://www.buymeacoffee.com/victordiaz" ));
61
+
62
+ TextView phonkVersionName = findViewById (R .id .versionName );
63
+ phonkVersionName .setText (BuildConfig .VERSION_NAME );
64
+
65
+ videoView = findViewById (R .id .videoView );
66
+ String videoURI = "android.resource://" + getPackageName () + "/" + R .raw .phonk ;
67
+ videoView .setVideoURI (Uri .parse (videoURI ));
68
+ // videoView.setBackgroundColor(Color.WHITE);
69
+
70
+ videoView .setOnPreparedListener (new MediaPlayer .OnPreparedListener () {
71
+ @ Override
72
+ public void onPrepared (MediaPlayer mediaPlayer ) {
73
+ mediaPlayer .setLooping (true );
74
+ videoView .setBackgroundColor (Color .TRANSPARENT );
75
+ // videoView.setZOrderOnTop(true);
76
+ }
77
+ });
78
+ videoView .start ();
79
+ }
80
+
81
+ private void openLink (String url ) {
82
+ Intent i = new Intent (Intent .ACTION_VIEW );
83
+ i .setData (Uri .parse (url ));
84
+ startActivity (i );
52
85
}
53
86
54
87
@ Override
@@ -57,4 +90,10 @@ protected void setupActivity() {
57
90
58
91
enableBackOnToolbar ();
59
92
}
93
+
94
+ @ Override
95
+ protected void onResume () {
96
+ super .onResume ();
97
+ videoView .start ();
98
+ }
60
99
}
0 commit comments