mirror of
https://github.com/gsantner/dandelion
synced 2024-11-21 11:52:07 +01:00
Android Studio 2.0; bump libs; gradle version
This commit is contained in:
parent
c8b2e0f0da
commit
88801f6961
12 changed files with 40 additions and 42 deletions
|
@ -10,7 +10,7 @@ android:
|
|||
- platform-tools
|
||||
- tools
|
||||
- android-23
|
||||
- build-tools-23.0.2
|
||||
- build-tools-23.0.3
|
||||
- extra-google-m2repository
|
||||
- extra-android-m2repository
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
|
|||
|
||||
android {
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion "23.0.2"
|
||||
buildToolsVersion "23.0.3"
|
||||
useLibrary 'org.apache.http.legacy'
|
||||
|
||||
defaultConfig {
|
||||
|
@ -23,8 +23,8 @@ android {
|
|||
dependencies {
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
testCompile 'junit:junit:4.12'
|
||||
compile 'com.android.support:appcompat-v7:23.2.1'
|
||||
compile 'com.android.support:design:23.2.1'
|
||||
compile 'com.android.support:appcompat-v7:23.3.0'
|
||||
compile 'com.android.support:design:23.3.0'
|
||||
compile 'com.getbase:floatingactionbutton:1.9.1'
|
||||
compile 'com.jakewharton:butterknife:7.0.1'
|
||||
}
|
||||
|
|
|
@ -231,11 +231,11 @@ public class MainActivity extends AppCompatActivity
|
|||
String cookies = cookieManager.getCookie(url);
|
||||
Log.d(App.TAG, "All the cookies in a string:" + cookies);
|
||||
|
||||
if(cookies != null) {
|
||||
if (cookies != null) {
|
||||
cookieManager.setCookie(url, cookies);
|
||||
cookieManager.setCookie("https://"+appSettings.getPodDomain(),cookies);
|
||||
for(String c:cookies.split(";")){
|
||||
Log.d(App.TAG, "Cookie: " + c.split("=")[0]+ " Value:"+c.split("=")[1]);
|
||||
cookieManager.setCookie("https://" + appSettings.getPodDomain(), cookies);
|
||||
for (String c : cookies.split(";")) {
|
||||
Log.d(App.TAG, "Cookie: " + c.split("=")[0] + " Value:" + c.split("=")[1]);
|
||||
}
|
||||
//new ProfileFetchTask(app).execute();
|
||||
}
|
||||
|
@ -972,8 +972,7 @@ public class MainActivity extends AppCompatActivity
|
|||
}
|
||||
break;
|
||||
|
||||
case R.id.nav_settings_view:
|
||||
{
|
||||
case R.id.nav_settings_view: {
|
||||
final CharSequence[] options = {getString(R.string.settings_font), getString(R.string.settings_view), appSettings.isLoadImages() ?
|
||||
getString(R.string.settings_images_switch_off) : getString(R.string.settings_images_switch_on)};
|
||||
|
||||
|
@ -982,12 +981,15 @@ public class MainActivity extends AppCompatActivity
|
|||
.setItems(options, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int item) {
|
||||
switch(item) {
|
||||
case 0: alertFormElements();
|
||||
switch (item) {
|
||||
case 0:
|
||||
alertFormElements();
|
||||
break;
|
||||
case 1: webView.loadUrl("https://" + podDomain + "/mobile/toggle");
|
||||
case 1:
|
||||
webView.loadUrl("https://" + podDomain + "/mobile/toggle");
|
||||
break;
|
||||
case 2: webSettings.setLoadsImagesAutomatically(!appSettings.isLoadImages());
|
||||
case 2:
|
||||
webSettings.setLoadsImagesAutomatically(!appSettings.isLoadImages());
|
||||
appSettings.setLoadImages(!appSettings.isLoadImages());
|
||||
webView.loadUrl(webView.getUrl());
|
||||
break;
|
||||
|
@ -1107,8 +1109,7 @@ public class MainActivity extends AppCompatActivity
|
|||
case REQUEST_CODE_ASK_PERMISSIONS_SAVE_IMAGE:
|
||||
if (grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||
Toast.makeText(this, R.string.permission_granted_try_again, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Toast.makeText(this, R.string.permission_denied, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
return;
|
||||
|
|
|
@ -51,8 +51,8 @@ import java.util.Date;
|
|||
|
||||
public class ShareActivity extends MainActivity {
|
||||
|
||||
private WebView webView;
|
||||
private static final String TAG = "Diaspora Share";
|
||||
private WebView webView;
|
||||
private String podDomain;
|
||||
private ValueCallback<Uri[]> mFilePathCallback;
|
||||
private String mCameraPhotoPath;
|
||||
|
|
|
@ -51,8 +51,8 @@ import java.util.Date;
|
|||
|
||||
public class ShareActivity2 extends MainActivity {
|
||||
|
||||
private WebView webView;
|
||||
private static final String TAG = "Diaspora Share";
|
||||
private WebView webView;
|
||||
private String podDomain;
|
||||
private ValueCallback<Uri[]> mFilePathCallback;
|
||||
private String mCameraPhotoPath;
|
||||
|
|
|
@ -14,17 +14,10 @@ import java.util.List;
|
|||
|
||||
public class SoftKeyboardStateWatcher implements ViewTreeObserver.OnGlobalLayoutListener {
|
||||
|
||||
public interface SoftKeyboardStateListener {
|
||||
void onSoftKeyboardOpened(int keyboardHeightInPx);
|
||||
|
||||
void onSoftKeyboardClosed();
|
||||
}
|
||||
|
||||
private final List<SoftKeyboardStateListener> listeners = new LinkedList<>();
|
||||
private final View activityRootView;
|
||||
private int lastSoftKeyboardHeightInPx;
|
||||
private boolean isSoftKeyboardOpened;
|
||||
|
||||
public SoftKeyboardStateWatcher(View activityRootView) {
|
||||
this(activityRootView, false);
|
||||
}
|
||||
|
@ -93,4 +86,10 @@ public class SoftKeyboardStateWatcher implements ViewTreeObserver.OnGlobalLayout
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public interface SoftKeyboardStateListener {
|
||||
void onSoftKeyboardOpened(int keyboardHeightInPx);
|
||||
|
||||
void onSoftKeyboardClosed();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ public class ProfileFetchTask extends AsyncTask<Void, Void, Void> {
|
|||
if (extractedProfileData != null) {
|
||||
WebUserProfile profile = new WebUserProfile(app);
|
||||
profile.parseJson(extractedProfileData);
|
||||
Log.d(App.TAG, "Extracted new_messages (service):"+profile.getUnreadMessagesCount());
|
||||
Log.d(App.TAG, "Extracted new_messages (service):" + profile.getUnreadMessagesCount());
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -57,7 +57,7 @@ public class ContextMenuWebView extends WebView {
|
|||
public boolean onMenuItemClick(MenuItem item) {
|
||||
HitTestResult result = getHitTestResult();
|
||||
String url = result.getExtra();
|
||||
switch(item.getItemId()) {
|
||||
switch (item.getItemId()) {
|
||||
//Save image to external memory
|
||||
case ID_SAVE_IMAGE: {
|
||||
boolean writeToStoragePermitted = true;
|
||||
|
@ -83,7 +83,7 @@ public class ContextMenuWebView extends WebView {
|
|||
MainActivity.REQUEST_CODE_ASK_PERMISSIONS_SAVE_IMAGE);
|
||||
}
|
||||
}
|
||||
if(writeToStoragePermitted) {
|
||||
if (writeToStoragePermitted) {
|
||||
if (url != null) {
|
||||
Uri source = Uri.parse(url);
|
||||
DownloadManager.Request request = new DownloadManager.Request(source);
|
||||
|
@ -96,10 +96,10 @@ public class ContextMenuWebView extends WebView {
|
|||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case ID_EXTERNAL_BROWSER:
|
||||
if(url != null) {
|
||||
if (url != null) {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ public class ContextMenuWebView extends WebView {
|
|||
|
||||
//Copy url to clipboard
|
||||
case ID_COPY_LINK:
|
||||
if(url != null) {
|
||||
if (url != null) {
|
||||
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
clipboard.setPrimaryClip(ClipData.newPlainText("text", url));
|
||||
Toast.makeText(context, R.string.toast_link_address_copied, Toast.LENGTH_SHORT).show();
|
||||
|
@ -116,7 +116,7 @@ public class ContextMenuWebView extends WebView {
|
|||
|
||||
//Try to share link to other apps
|
||||
case ID_SHARE_LINK:
|
||||
if(url != null) {
|
||||
if (url != null) {
|
||||
Intent sendIntent = new Intent();
|
||||
sendIntent.setAction(Intent.ACTION_SEND);
|
||||
sendIntent.putExtra(Intent.EXTRA_TEXT, url);
|
||||
|
@ -137,8 +137,7 @@ public class ContextMenuWebView extends WebView {
|
|||
menu.setHeaderTitle(result.getExtra());
|
||||
menu.add(0, ID_SAVE_IMAGE, 0, context.getString(R.string.context_menu_save_image)).setOnMenuItemClickListener(handler);
|
||||
menu.add(0, ID_EXTERNAL_BROWSER, 0, context.getString(R.string.context_menu_open_external_browser)).setOnMenuItemClickListener(handler);
|
||||
}
|
||||
else if (result.getType() == HitTestResult.ANCHOR_TYPE ||
|
||||
} else if (result.getType() == HitTestResult.ANCHOR_TYPE ||
|
||||
result.getType() == HitTestResult.SRC_ANCHOR_TYPE) {
|
||||
// Menu options for a hyperlink.
|
||||
menu.setHeaderTitle(result.getExtra());
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/label_background"/>
|
||||
<solid android:color="@color/label_background" />
|
||||
<padding
|
||||
android:bottom="4dp"
|
||||
android:left="16dp"
|
||||
android:top="4dp"
|
||||
android:right="16dp"
|
||||
android:bottom="4dp"/>
|
||||
<corners
|
||||
android:radius="2dp"/>
|
||||
android:top="4dp" />
|
||||
<corners android:radius="2dp" />
|
||||
</shape>
|
|
@ -5,7 +5,7 @@ buildscript {
|
|||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:1.5.0'
|
||||
classpath 'com.android.tools.build:gradle:2.0.0'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,6 +1,6 @@
|
|||
#Wed Oct 21 11:34:03 PDT 2015
|
||||
#Mon Dec 28 10:00:20 PST 2015
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
|
||||
|
|
Loading…
Reference in a new issue