diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..4aaa807 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,28 @@ +language: android +jdk: oraclejdk8 + +android: + components: + - tools + - platform-tools + +before_install: + # Install SDK license so Android Gradle plugin can install deps. + - mkdir "$ANDROID_HOME/licenses" || true + - echo "8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license" + - yes | sdkmanager tools + + +script: + - ./gradlew check test + +sudo: false + +before_cache: + - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock + - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ + +cache: + directories: + - $HOME/.gradle/caches/ + - $HOME/.gradle/wrapper/ \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index dc00fe6..49de559 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,15 +1,15 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 26 - buildToolsVersion '26.0.1' + compileSdkVersion 27 + dataBinding { enabled = true } defaultConfig { applicationId "se.eelde.granter.app" minSdkVersion 17 - targetSdkVersion 26 + targetSdkVersion 27 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -27,9 +27,8 @@ android { } dependencies { - implementation 'com.android.support:appcompat-v7:26.0.2' + implementation 'com.android.support:appcompat-v7:27.0.1' + implementation 'com.android.support:support-v4:27.0.1' implementation 'com.android.support.constraint:constraint-layout:1.0.2' implementation project(path: ':granter') - - compile 'com.greysonparrelli.permiso:permiso:0.3.0' } diff --git a/app/src/main/java/se/eelde/granter/app/PermisoPermissionActivity.java b/app/src/main/java/se/eelde/granter/app/PermisoPermissionActivity.java deleted file mode 100644 index e460166..0000000 --- a/app/src/main/java/se/eelde/granter/app/PermisoPermissionActivity.java +++ /dev/null @@ -1,49 +0,0 @@ -package se.eelde.granter.app; - -import android.Manifest; -import android.content.Context; -import android.content.Intent; -import android.databinding.DataBindingUtil; -import android.os.Bundle; - -import com.greysonparrelli.permiso.Permiso; -import com.greysonparrelli.permiso.PermisoActivity; - -import se.eelde.granter.app.databinding.ActivityPermisoPermissionBinding; - -public class PermisoPermissionActivity extends PermisoActivity { - - private ActivityPermisoPermissionBinding binding; - - public static void start(Context context) { - context.startActivity(new Intent(context, PermisoPermissionActivity.class)); - } - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_regular_permission); - binding = DataBindingUtil.setContentView(this, R.layout.activity_permiso_permission); - - Permiso.getInstance().setActivity(this); - - binding.permisoPermission.setOnClickListener(view -> Permiso.getInstance().requestPermissions(new Permiso.IOnPermissionResult() { - @Override - public void onPermissionResult(Permiso.ResultSet resultSet) { - moveToNextStep(); - } - - @Override - public void onRationaleRequested(Permiso.IOnRationaleProvided callback, String... permissions) { - Permiso.getInstance().showRationaleInDialog("Title", "Message", null, callback); - } - }, Manifest.permission.ACCESS_FINE_LOCATION)); - } - - private void moveToNextStep() { - getSupportFragmentManager() - .beginTransaction() - .replace(binding.fragmentContainer.getId(), DummyFragment.newInstance()) - .commit(); - } -} diff --git a/app/src/main/java/se/eelde/granter/app/PermissionRequestingActivity.java b/app/src/main/java/se/eelde/granter/app/PermissionRequestingActivity.java index 1212fa2..09208c0 100644 --- a/app/src/main/java/se/eelde/granter/app/PermissionRequestingActivity.java +++ b/app/src/main/java/se/eelde/granter/app/PermissionRequestingActivity.java @@ -29,8 +29,6 @@ protected void onCreate(Bundle savedInstanceState) { binding.regularPermission.setOnClickListener(view -> RegularPermissionActivity.start(this)); - binding.buttonPermisoPermission.setOnClickListener(view -> PermisoPermissionActivity.start(this)); - binding.permission1Button.setOnClickListener(view -> new Granter.Builder(this) .requestCode(RC_CAMERA) .addPermission(Manifest.permission.CAMERA) diff --git a/app/src/main/res/layout/activity_permission_requesting.xml b/app/src/main/res/layout/activity_permission_requesting.xml index 5480229..bdb32e1 100644 --- a/app/src/main/res/layout/activity_permission_requesting.xml +++ b/app/src/main/res/layout/activity_permission_requesting.xml @@ -29,8 +29,7 @@ android:text="@string/permission_1" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/button_permiso_permission" /> - + app:layout_constraintTop_toBottomOf="@+id/regular_permission" />