Skip to content

Commit

Permalink
new build with splash screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Grzegorz Kapusta authored and Grzegorz Kapusta committed Jul 27, 2018
1 parent 06a067a commit d733f75
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ android {
applicationId "pl.pola_app"
minSdkVersion 16
targetSdkVersion 25
versionCode 25
versionName "1.6"
versionCode 26
versionName "1.6.1"
}

signingConfigs {
Expand Down
12 changes: 9 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@
android:label="@string/app_name"
android:largeHeap="true"
android:theme="@style/AppTheme">

<activity
android:name=".ui.activity.MainActivity"
android:label="@string/app_name"
android:name=".ui.activity.SplashActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Expand All @@ -34,6 +33,13 @@
android:name="io.fabric.ApiKey"
android:value="6a4f6710db1c4c62907f73a43eb5e68675cd2c7a" />

<activity
android:name=".ui.activity.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:screenOrientation="portrait">
</activity>

<activity
android:name=".ui.activity.CreateReportActivity"
android:label="@string/title_activity_create_report"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/pl/pola_app/ui/activity/MainPresenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ public void onBarcode(String barcode, boolean fromCamera) {
public void onResponse(Call<SearchResult> call, Response<SearchResult> response) {
final SearchResult searchResult = response.body();
currentSearchResult = searchResult;
logger.logContentView(searchResult.name + "",
logger.logContentView((searchResult.name != null) ? searchResult.name + "" : "empty",
"company_received",
String.valueOf(searchResult.product_id),
String.valueOf(searchResult.code),
(searchResult.code != null) ? searchResult.code : "empty",
sessionId.get(),
searchResult.askForPics());
productList.addProduct(searchResult);
Expand Down
26 changes: 26 additions & 0 deletions app/src/main/java/pl/pola_app/ui/activity/SplashActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package pl.pola_app.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import pl.pola_app.R;


public class SplashActivity extends AppCompatActivity {
private static final long SPLASH_DELAY = 1500;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);


new Handler().postDelayed(() -> {
startActivity(new Intent(SplashActivity.this, MainActivity.class));
finish();
}, SPLASH_DELAY);
}
}
Binary file added app/src/main/res/drawable-hdpi/splash_screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/splash_screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions app/src/main/res/layout/activity_splash.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">

<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:background="@drawable/splash_screen" />

</RelativeLayout>
1 change: 0 additions & 1 deletion app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<item name="android:windowActionBar">false</item>
</style>


<style name="AppThemeLight" parent="@style/Theme.AppCompat.Light.NoActionBar">
<item name="android:windowActionBar">false</item>
</style>
Expand Down

0 comments on commit d733f75

Please sign in to comment.