Skip to content

Commit

Permalink
change dialog style during authing evernote
Browse files Browse the repository at this point in the history
  • Loading branch information
lguipeng committed Aug 22, 2015
1 parent 0ce17ce commit 61045e6
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 6 deletions.
2 changes: 0 additions & 2 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/22.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/22.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.pnikosis/materialish-progress/1.5/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.rengwuxian.materialedittext/library/2.1.3/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
Expand Down Expand Up @@ -107,7 +106,6 @@
<orderEntry type="library" exported="" name="libammsdk" level="project" />
<orderEntry type="library" exported="" name="okhttp-2.4.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-22.2.1" level="project" />
<orderEntry type="library" exported="" name="materialish-progress-1.5" level="project" />
<orderEntry type="library" exported="" name="javax.inject-1" level="project" />
<orderEntry type="library" exported="" name="guava-15.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-22.2.1" level="project" />
Expand Down
1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ dependencies {
compile 'com.squareup.dagger:dagger:1.2.2'
provided 'com.squareup.dagger:dagger-compiler:1.2.2'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.pnikosis:materialish-progress:1.5'
compile project(':orm-library')
compile project(':evernote-sdk')
compile project(':md-preference')
Expand Down
1 change: 1 addition & 0 deletions evernote-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dependencies {
compile 'org.scribe:scribe:1.3.5'
compile 'net.vrallev.android:android-task:1.0.4'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.pnikosis:materialish-progress:1.5'
}

android {
Expand Down
2 changes: 2 additions & 0 deletions evernote-sdk/evernote-sdk.iml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.pnikosis/materialish-progress/1.5/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/net.vrallev.android/android-task/1.0.4/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
Expand All @@ -98,6 +99,7 @@
<orderEntry type="library" exported="" name="support-annotations-22.1.1" level="project" />
<orderEntry type="library" exported="" name="okhttp-2.4.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-22.1.1" level="project" />
<orderEntry type="library" exported="" name="materialish-progress-1.5" level="project" />
<orderEntry type="library" exported="" name="okio-1.4.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-22.1.1" level="project" />
</component>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.evernote.client.android.login;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
Expand All @@ -14,6 +13,7 @@
import com.evernote.androidsdk.R;
import com.evernote.client.android.EvernoteOAuthHelper;
import com.evernote.client.android.EvernoteSession;
import com.evernote.client.view.ProgressDialog;

import net.vrallev.android.task.TaskExecutor;
import net.vrallev.android.task.TaskResult;
Expand Down Expand Up @@ -129,8 +129,6 @@ public void onClick(DialogInterface dialog, int which) {
};

mProgressDialog = new ProgressDialog(this);
mProgressDialog.setIndeterminate(true);
mProgressDialog.setMessage(getString(R.string.esdk_loading));
mProgressDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getString(android.R.string.cancel), onClickListener);
mProgressDialog.setCancelable(false);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.evernote.client.view;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;

import com.evernote.androidsdk.R;
import com.pnikosis.materialishprogress.ProgressWheel;


/**
* Created by lgp on 2015/8/22.
*/
public class ProgressDialog extends AlertDialog {
public ProgressDialog(Context context) {
super(context, R.style.esdk_GreenDialogTheme);
}

public ProgressDialog(Context context, int theme) {
super(context, theme);
}

@Override
protected void onCreate(Bundle savedInstanceState) {
View view = LayoutInflater.from(getContext()).inflate(R.layout.dialog_progress, null);
setView(view);
ProgressWheel wheel = (ProgressWheel)view.findViewById(R.id.progress_wheel);
wheel.spin();
super.onCreate(savedInstanceState);
}
}
26 changes: 26 additions & 0 deletions evernote-sdk/src/main/res/layout/dialog_progress.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:wheel="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.pnikosis.materialishprogress.ProgressWheel
android:id="@+id/progress_wheel"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:visibility="visible"
android:layout_gravity="center"
wheel:matProg_spinSpeed="1.2"
wheel:matProg_barColor="#4CAF50"
wheel:matProg_progressIndeterminate="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingLeft="10dp"
android:layout_marginTop="10dp"
android:textSize="16sp"
android:text="@string/esdk_loading"/>
</LinearLayout>
9 changes: 9 additions & 0 deletions evernote-sdk/src/main/res/values/style.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="esdk_GreenDialogTheme" parent="Theme.AppCompat.Light.Dialog">
<item name="colorPrimary">#4CAF50</item>
<item name="colorPrimaryDark">#388E3C</item>
<item name="colorAccent">#4CAF50</item>
<item name="android:minWidth">200dp</item>
</style>
</resources>

0 comments on commit 61045e6

Please sign in to comment.