Skip to content

Commit

Permalink
Added load screen. Jobs persisted for requirement #6
Browse files Browse the repository at this point in the history
  • Loading branch information
Javinator9889 committed Mar 5, 2018
1 parent cadc982 commit 171d725
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 6 deletions.
Binary file modified app/debug/app-debug.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion app/debug/output.json
@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":36},"path":"app-debug.apk","properties":{"packageId":"javinator9889.bitcoinpools","split":"","minSdkVersion":"21"}}]
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":40},"path":"app-debug.apk","properties":{"packageId":"javinator9889.bitcoinpools","split":"","minSdkVersion":"21"}}]
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Expand Up @@ -20,7 +20,8 @@
<activity
android:name=".DataLoaderScreen"
android:configChanges="orientation"
android:screenOrientation="portrait">
android:screenOrientation="portrait"
android:theme="@style/AppTheme.Launcher">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Expand Up @@ -36,6 +36,7 @@

public class DataLoaderScreen extends AppCompatActivity {
public static MaterialDialog progressDialog = null;
public static AppCompatActivity dataLoaderScreenActivity;

private float mpu;
private HashMap<String, Float> retrievedData;
Expand All @@ -45,6 +46,7 @@ public class DataLoaderScreen extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
dataLoaderScreenActivity = this;
if (BitCoinApp.isOnline()) {
Log.d(Constants.LOG.MATAG, Constants.LOG.CREATING_MAINVIEW);
setContentView(R.layout.activity_loading);
Expand All @@ -58,6 +60,20 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
progressDialog.show();
new DataLoader().execute();
//new MainActivity.DataLoader().execute();
} else {
new MaterialDialog.Builder(this)
.title(R.string.noConnectionTitle)
.content(R.string.noConnectionDesc)
.cancelable(false)
.positiveText(R.string.accept)
.onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
onBackPressed();
}
})
.build()
.show();
}
}

Expand Down Expand Up @@ -88,7 +104,7 @@ protected void onPostExecute(Boolean result) {
activityMainIntent.putExtra("CARDS", cardsData);
activityMainIntent.putExtra("BTCPRICE", btcPrice);
startActivity(activityMainIntent);
DataLoaderScreen.this.finish();
//DataLoaderScreen.this.finish();
} else {
Log.i("DLS", "Data non-loaded...");
if (progressDialog != null) {
Expand Down
@@ -1,5 +1,6 @@
package javinator9889.bitcoinpools.FragmentViews;

import android.content.Context;
import android.graphics.Typeface;
import android.os.Bundle;
import android.os.Handler;
Expand Down
Expand Up @@ -156,7 +156,9 @@ public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which)
protected void onResume() {
super.onResume();
//DataLoaderScreen.progressDialog.setProgress(DataLoaderScreen.progressDialog.getCurrentProgress() + 5);
DataLoaderScreen.progressDialog.dismiss();
//DataLoaderScreen.progressDialog.dismiss();
Toast.makeText(this, "Hi, the activity is fully loaded", Toast.LENGTH_LONG).show();
DataLoaderScreen.dataLoaderScreenActivity.finish();
}


Expand Down
11 changes: 11 additions & 0 deletions app/src/main/res/drawable/launch_screen.xml
@@ -0,0 +1,11 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque">
<!-- The background color, preferably the same as your normal theme -->
<!--<item android:drawable="@android:color/white"/>-->
<item android:drawable="@color/colorPrimaryDark"/>
<!-- Your product logo - 144dp color version of your app icon -->
<item>
<bitmap
android:src="@drawable/ic_launcher_foreground"
android:gravity="center"/>
</item>
</layer-list>
5 changes: 3 additions & 2 deletions app/src/main/res/values/styles.xml
Expand Up @@ -36,8 +36,9 @@
<item name="android:textColor">#FAFAFA</item>
</style>

<style name="MyMaterialTheme" parent="MyMaterialTheme.Base">

<style name="AppTheme.Launcher" parent="CustomTheme">
<item name="android:windowBackground">@drawable/launch_screen</item>
<!-- <item name="colorBackground">@color/colorPrimaryDark</item>-->
</style>

<style name="MyMaterialTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
Expand Down

0 comments on commit 171d725

Please sign in to comment.