Skip to content

Commit

Permalink
Update Build Tools v26.0.2
Browse files Browse the repository at this point in the history
*Update Build Tools and SDK to v26.0.2.
*Version bump to v1.2.
  • Loading branch information
rayliverified committed Oct 5, 2017
1 parent c393547 commit 5585572
Show file tree
Hide file tree
Showing 4 changed files with 382 additions and 379 deletions.
70 changes: 37 additions & 33 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "stream.custompermissionsapp"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

repositories {
maven { url 'https://jitpack.io' }
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(path: ':custompermissionsdialogue')

compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-vector-drawable:25.3.1'
}
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "stream.custompermissionsapp"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

repositories {
maven { url 'https://jitpack.io' }
}

dependencies {
repositories {
maven { url "https://maven.google.com" }
}

compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(path: ':custompermissionsdialogue')

compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support:design:26.0.2'
compile 'com.android.support:support-vector-drawable:26.0.2'
}
191 changes: 94 additions & 97 deletions app/src/main/java/stream/custompermissionsapp/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,97 +1,94 @@
package stream.custompermissionsapp;

import android.app.Activity;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;

import java.lang.ref.WeakReference;

public class MainActivity extends AppCompatActivity {

private static WeakReference<Activity> mActivityRef;
public final String mActivity = "IntroActivity";

private Fragment fragment;
private Context mContext;

@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
setContentView(R.layout.activity_intro);
mContext = getApplicationContext();
mActivityRef = new WeakReference<Activity>(this);

if (savedInstanceState != null) {

fragment = getSupportFragmentManager().getFragment(savedInstanceState, "currentFragment");

} else {

fragment = new PermissionsFragment();
}

FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction().replace(R.id.fragmentcontainer, fragment, "currentFragment").commit();
}

@Override
protected void onPause() {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
//Removes flickering from setting window fullscreen
Handler handler = new Handler();
handler.post(new Runnable() {
@Override
public void run() {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
});
}
super.onPause();
}

@Override
protected void onSaveInstanceState(Bundle outState) {

super.onSaveInstanceState(outState);
if (getSupportFragmentManager().findFragmentByTag("currentFragment") != null)
{
fragment = getSupportFragmentManager().findFragmentByTag("currentFragment");
getSupportFragmentManager().putFragment(outState, "currentFragment", fragment);
}
}

@Override
protected void onResume() {
super.onResume();
}

@Override
public void onWindowFocusChanged(boolean hasFocus) {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
if (hasFocus) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
}
super.onWindowFocusChanged(hasFocus);
}
}
package stream.custompermissionsapp;

import android.app.Activity;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;

import java.lang.ref.WeakReference;

public class MainActivity extends AppCompatActivity {

private Fragment fragment;
private Context mContext;
public final String mActivity = "MainActivity";

@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
setContentView(R.layout.activity_intro);
mContext = getApplicationContext();

if (savedInstanceState != null) {

fragment = getSupportFragmentManager().getFragment(savedInstanceState, "currentFragment");

} else {

fragment = new PermissionsFragment();
}

FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction().replace(R.id.fragmentcontainer, fragment, "currentFragment").commit();
}

@Override
protected void onPause() {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
//Removes flickering from setting window fullscreen
Handler handler = new Handler();
handler.post(new Runnable() {
@Override
public void run() {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
});
}
super.onPause();
}

@Override
protected void onSaveInstanceState(Bundle outState) {

super.onSaveInstanceState(outState);
if (getSupportFragmentManager().findFragmentByTag("currentFragment") != null)
{
fragment = getSupportFragmentManager().findFragmentByTag("currentFragment");
getSupportFragmentManager().putFragment(outState, "currentFragment", fragment);
}
}

@Override
protected void onResume() {
super.onResume();
}

@Override
public void onWindowFocusChanged(boolean hasFocus) {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
if (hasFocus) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
}
super.onWindowFocusChanged(hasFocus);
}
}
Loading

0 comments on commit 5585572

Please sign in to comment.