Commit a80ca961 authored by luca020400's avatar luca020400 Committed by luca020400

Jelly: Update for API 26

Change-Id: Ie1eab68ada929d13ac43cd161fa9e6409af3092b
parent 96f863cc
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "org.lineageos.jelly"
minSdkVersion 24
targetSdkVersion 25
minSdkVersion 26
targetSdkVersion 26
versionCode 1
versionName "1.0"
jackOptions.enabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
disable 'RestrictedApi'
}
sourceSets {
main.java.srcDirs += 'src/main/java_studio'
}
......@@ -31,9 +35,9 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:palette-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.android.support:cardview-v7:26.0.1'
compile 'com.android.support:palette-v7:26.0.1'
compile 'com.android.support:support-v4:26.0.1'
}
......@@ -24,12 +24,15 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.content.pm.ShortcutInfo;
import android.content.pm.ShortcutManager;
import android.content.res.ColorStateList;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
import android.graphics.drawable.TransitionDrawable;
import android.net.Uri;
import android.net.http.HttpResponseCache;
......@@ -666,15 +669,16 @@ public class MainActivity extends WebViewExtActivity implements
BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher) : mUrlIcon;
Bitmap launcherIcon = UiUtils.getShortcutIcon(icon, getThemeColorWithFallback());
Intent addIntent = new Intent();
addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, mWebView.getTitle());
addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON, launcherIcon);
addIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, intent);
addIntent.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
sendBroadcast(addIntent);
String title = mWebView.getTitle();
ShortcutInfo shortcutInfo = new ShortcutInfo.Builder(this, title)
.setShortLabel(title)
.setIcon(Icon.createWithBitmap(launcherIcon))
.setIntent(intent)
.build();
getSystemService(ShortcutManager.class).requestPinShortcut(shortcutInfo, null);
launcherIcon.recycle();
Snackbar.make(mCoordinator, getString(R.string.shortcut_added),
Snackbar.LENGTH_LONG).show();
}
private void setImmersiveMode(boolean enable) {
......
......@@ -67,9 +67,6 @@
<!-- Permission error snackBar: the permission has been denied until user enables it in settings -->
<string name="permission_error_forever">Permission denied permanently. Please grant it in settings</string>
<!-- Shortcut: the current webPage has been added to the launcher -->
<string name="shortcut_added">Added to the home screen</string>
<!-- Settings: title -->
<string name="settings_title">Settings</string>
<!-- Settings: search engine preference title -->
......
......@@ -2,10 +2,11 @@
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.0.0-beta2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
......
#Fri Apr 14 16:24:15 CEST 2017
#Wed Aug 16 14:14:00 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment