summaryrefslogtreecommitdiffstats
path: root/app/src/main/java/com/xc3fff0e/xmanager/SplashActivity.java
blob: be18bd1a71d2f78b4a1b1d49fb1df1cda863d830 (plain) (blame)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
package com.xc3fff0e.xmanager;

import android.animation.*;
import android.app.*;
import android.content.*;
import android.content.Intent;
import android.content.res.*;
import android.graphics.*;
import android.graphics.Typeface;
import android.graphics.drawable.*;
import android.media.*;
import android.net.*;
import android.net.Uri;
import android.os.*;
import android.text.*;
import android.text.style.*;
import android.util.*;
import android.view.*;
import android.view.View.*;
import android.view.animation.*;
import android.webkit.*;
import android.widget.*;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.*;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import com.google.android.gms.ads.MobileAds;
import com.google.android.material.*;
import com.google.firebase.FirebaseApp;
import com.wuyr.rippleanimation.*;
import java.io.*;
import java.text.*;
import java.util.*;
import java.util.Timer;
import java.util.TimerTask;
import java.util.regex.*;
import org.json.*;

public class SplashActivity extends AppCompatActivity {
	
	private Timer _timer = new Timer();
	
	private LinearLayout main_body;
	private ImageView icon_splash;
	private TextView title_splash;
	
	private TimerTask Timer;
	private Intent Switch_Activity = new Intent();
	
	@Override
	protected void onCreate(Bundle _savedInstanceState) {
		super.onCreate(_savedInstanceState);
		setContentView(R.layout.splash);
		initialize(_savedInstanceState);
		FirebaseApp.initializeApp(this);
		MobileAds.initialize(this);
		
		initializeLogic();
	}
	
	private void initialize(Bundle _savedInstanceState) {
		main_body = findViewById(R.id.main_body);
		icon_splash = findViewById(R.id.icon_splash);
		title_splash = findViewById(R.id.title_splash);
	}
	
	private void initializeLogic() {
		if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) {
			Window w =SplashActivity.this.getWindow();
			w.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
			w.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); w.setStatusBarColor(0xFF171717);
		}
		title_splash.setTypeface(Typeface.createFromAsset(getAssets(),"fonts/base_glitch.ttf"), 1);
		if (0 == SketchwareUtil.getRandom((int)(0), (int)(9))) {
			title_splash.setText("xManager");
			title_splash.setTextSize((int)25);
		}
		else {
			if (1 == SketchwareUtil.getRandom((int)(0), (int)(9))) {
				title_splash.setText("Made with Love");
				title_splash.setTextSize((int)25);
			}
			else {
				if (2 == SketchwareUtil.getRandom((int)(0), (int)(9))) {
					title_splash.setText("Freedom");
					title_splash.setTextSize((int)25);
				}
				else {
					if (3 == SketchwareUtil.getRandom((int)(0), (int)(9))) {
						title_splash.setText("Superior");
						title_splash.setTextSize((int)25);
					}
					else {
						if (4 == SketchwareUtil.getRandom((int)(0), (int)(9))) {
							title_splash.setText("Superlative");
							title_splash.setTextSize((int)25);
						}
						else {
							if (5 == SketchwareUtil.getRandom((int)(0), (int)(9))) {
								title_splash.setText("Never Go Back");
								title_splash.setTextSize((int)25);
							}
							else {
								if (6 == SketchwareUtil.getRandom((int)(0), (int)(9))) {
									title_splash.setText("Saving Your $10");
									title_splash.setTextSize((int)25);
								}
								else {
									if (7 == SketchwareUtil.getRandom((int)(0), (int)(9))) {
										title_splash.setText("It's A Movement");
										title_splash.setTextSize((int)25);
									}
									else {
										if (8 == SketchwareUtil.getRandom((int)(0), (int)(9))) {
											title_splash.setText("We Are Resistance");
											title_splash.setTextSize((int)20);
										}
										else {
											title_splash.setText("Spotify but on steroids");
											title_splash.setTextSize((int)20);
										}
									}
								}
							}
						}
					}
				}
			}
		}
		Animation animation_icon;
		animation_icon = AnimationUtils.loadAnimation(getApplicationContext(), android.R.anim.fade_in);
		animation_icon.setDuration(800); icon_splash.startAnimation(animation_icon);
		animation_icon = null;
		
		Animation animation_title;
		animation_title = AnimationUtils.loadAnimation(getApplicationContext(), android.R.anim.fade_in);
		animation_title.setDuration(800); title_splash.startAnimation(animation_title);
		animation_title = null;
		
		Timer = new TimerTask() {
			@Override
			public void run() {
				runOnUiThread(new Runnable() {
					@Override
					public void run() {
						Switch_Activity.setClass(getApplicationContext(), MainActivity.class);
						startActivity(Switch_Activity);
						finish();
					}
				});
			}
		};
		_timer.schedule(Timer, (int)(1000));
		_Dark_Navigation();
	}
	
	@Override
	public void onBackPressed() {
		com.google.android.material.snackbar.Snackbar.make(main_body, "Can't Go Back", com.google.android.material.snackbar.Snackbar.LENGTH_LONG).show();
	}
	public void _Dark_Navigation() {
		if (Build.VERSION.SDK_INT >= 21) {
				getWindow().setNavigationBarColor(Color.parseColor("#171717"));
		}
		
	}
	
	
	@Deprecated
	public void showMessage(String _s) {
		Toast.makeText(getApplicationContext(), _s, Toast.LENGTH_SHORT).show();
	}
	
	@Deprecated
	public int getLocationX(View _v) {
		int _location[] = new int[2];
		_v.getLocationInWindow(_location);
		return _location[0];
	}
	
	@Deprecated
	public int getLocationY(View _v) {
		int _location[] = new int[2];
		_v.getLocationInWindow(_location);
		return _location[1];
	}
	
	@Deprecated
	public int getRandom(int _min, int _max) {
		Random random = new Random();
		return random.nextInt(_max - _min + 1) + _min;
	}
	
	@Deprecated
	public ArrayList<Double> getCheckedItemPositionsToArray(ListView _list) {
		ArrayList<Double> _result = new ArrayList<Double>();
		SparseBooleanArray _arr = _list.getCheckedItemPositions();
		for (int _iIdx = 0; _iIdx < _arr.size(); _iIdx++) {
			if (_arr.valueAt(_iIdx))
			_result.add((double)_arr.keyAt(_iIdx));
		}
		return _result;
	}
	
	@Deprecated
	public float getDip(int _input) {
		return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, _input, getResources().getDisplayMetrics());
	}
	
	@Deprecated
	public int getDisplayWidthPixels() {
		return getResources().getDisplayMetrics().widthPixels;
	}
	
	@Deprecated
	public int getDisplayHeightPixels() {
		return getResources().getDisplayMetrics().heightPixels;
	}
}