mirror of
https://github.com/nerzhul/ownCloud-SMS-App.git
synced 2025-06-09 17:06:13 +00:00
Add a more stylized button for creating account
This commit is contained in:
parent
7e87253d5f
commit
b98758cff3
19
build.gradle
19
build.gradle
@ -1,13 +1,14 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 22
|
compileSdkVersion 23
|
||||||
buildToolsVersion "22.0.1"
|
buildToolsVersion "22.0.1"
|
||||||
|
useLibrary 'org.apache.http.legacy'
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "fr.unix_experience.owncloud_sms"
|
applicationId "fr.unix_experience.owncloud_sms"
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 22
|
targetSdkVersion 23
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
@ -18,8 +19,20 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
url 'https://oss.sonatype.org/content/repositories/snapshots'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':owncloudAndroidLibrary')
|
compile project(':owncloudAndroidLibrary')
|
||||||
compile project(':nrzandroidlib')
|
compile project(':nrzandroidlib')
|
||||||
compile files('libs/android-support-v13.jar')
|
compile 'com.android.support:support-v13:23.+'
|
||||||
|
compile 'com.android.support:appcompat-v7:23.+'
|
||||||
|
compile 'com.github.florent37:materialtextfield:1.0.1@aar'
|
||||||
|
compile 'com.android.support:cardview-v7:23.+'
|
||||||
|
compile 'com.nineoldandroids:library:2.4.0'
|
||||||
|
compile 'in.srain.cube:ultra-ptr:1.0.11'
|
||||||
|
compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
|
||||||
}
|
}
|
||||||
|
@ -35,11 +35,11 @@ import android.view.KeyEvent;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.dd.processbutton.iml.ActionProcessButton;
|
||||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||||
import com.owncloud.android.lib.common.OwnCloudClientFactory;
|
import com.owncloud.android.lib.common.OwnCloudClientFactory;
|
||||||
import com.owncloud.android.lib.common.OwnCloudCredentialsFactory;
|
import com.owncloud.android.lib.common.OwnCloudCredentialsFactory;
|
||||||
@ -64,6 +64,7 @@ public class LoginActivity extends Activity {
|
|||||||
private EditText _loginView;
|
private EditText _loginView;
|
||||||
private EditText _passwordView;
|
private EditText _passwordView;
|
||||||
private EditText _serverView;
|
private EditText _serverView;
|
||||||
|
private ActionProcessButton _signInButton;
|
||||||
private View mProgressView;
|
private View mProgressView;
|
||||||
private View mLoginFormView;
|
private View mLoginFormView;
|
||||||
|
|
||||||
@ -91,7 +92,7 @@ public class LoginActivity extends Activity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Button _signInButton = (Button) findViewById(R.id.oc_signin_button);
|
_signInButton = (ActionProcessButton) findViewById(R.id.oc_signin_button);
|
||||||
_signInButton.setOnClickListener(new OnClickListener() {
|
_signInButton.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
@ -161,12 +162,15 @@ public class LoginActivity extends Activity {
|
|||||||
if (cancel) {
|
if (cancel) {
|
||||||
// There was an error; don't attempt login and focus the first
|
// There was an error; don't attempt login and focus the first
|
||||||
// form field with an error.
|
// form field with an error.
|
||||||
|
// reset the button progress
|
||||||
|
_signInButton.setProgress(0);
|
||||||
if (focusView != null) {
|
if (focusView != null) {
|
||||||
focusView.requestFocus();
|
focusView.requestFocus();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Show a progress spinner, and kick off a background task to
|
// Show a progress spinner, and kick off a background task to
|
||||||
// perform the user login attempt.
|
// perform the user login attempt.
|
||||||
|
_signInButton.setProgress(25);
|
||||||
showProgress(true);
|
showProgress(true);
|
||||||
String serverURL = protocol + serverAddr;
|
String serverURL = protocol + serverAddr;
|
||||||
mAuthTask = new UserLoginTask(serverURL, login, password);
|
mAuthTask = new UserLoginTask(serverURL, login, password);
|
||||||
@ -259,8 +263,10 @@ public class LoginActivity extends Activity {
|
|||||||
protected void onPostExecute(Boolean success) {
|
protected void onPostExecute(Boolean success) {
|
||||||
mAuthTask = null;
|
mAuthTask = null;
|
||||||
showProgress(false);
|
showProgress(false);
|
||||||
|
_signInButton.setProgress(90);
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
|
_signInButton.setProgress(100);
|
||||||
String accountType = getIntent().getStringExtra(UserLoginTask.PARAM_AUTHTOKEN_TYPE);
|
String accountType = getIntent().getStringExtra(UserLoginTask.PARAM_AUTHTOKEN_TYPE);
|
||||||
if (accountType == null) {
|
if (accountType == null) {
|
||||||
accountType = getString(R.string.account_type);
|
accountType = getString(R.string.account_type);
|
||||||
@ -314,13 +320,17 @@ public class LoginActivity extends Activity {
|
|||||||
_passwordView.requestFocus();
|
_passwordView.requestFocus();
|
||||||
break;
|
break;
|
||||||
case UNKNOWN_ERROR:
|
case UNKNOWN_ERROR:
|
||||||
_serverView.setError("UNK");
|
_serverView.setError("UNK");
|
||||||
_serverView.requestFocus();
|
_serverView.requestFocus();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If not ok, reset the progress
|
||||||
|
if (_returnCode != LoginReturnCode.OK) {
|
||||||
|
_signInButton.setProgress(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import android.app.ListActivity;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
import fr.nrz.androidlib.adapters.AndroidAccountAdapter;
|
import fr.nrz.androidlib.adapters.AndroidAccountAdapter;
|
||||||
import fr.unix_experience.owncloud_sms.R;
|
import fr.unix_experience.owncloud_sms.R;
|
||||||
@ -21,7 +22,7 @@ public class AccountListActivity extends ListActivity {
|
|||||||
AccountManager _accountMgr = AccountManager.get(getBaseContext());
|
AccountManager _accountMgr = AccountManager.get(getBaseContext());
|
||||||
|
|
||||||
setContentView(R.layout.restore_activity_accountlist);
|
setContentView(R.layout.restore_activity_accountlist);
|
||||||
/*
|
|
||||||
adapter = new AndroidAccountAdapter(this,
|
adapter = new AndroidAccountAdapter(this,
|
||||||
android.R.layout.simple_list_item_1,
|
android.R.layout.simple_list_item_1,
|
||||||
listItems,
|
listItems,
|
||||||
@ -34,7 +35,7 @@ public class AccountListActivity extends ListActivity {
|
|||||||
Collections.addAll(listItems, accountList);
|
Collections.addAll(listItems, accountList);
|
||||||
|
|
||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,12 +108,14 @@
|
|||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:singleLine="true" />
|
android:singleLine="true" />
|
||||||
|
|
||||||
<Button
|
<com.dd.processbutton.iml.ActionProcessButton
|
||||||
android:id="@+id/oc_signin_button"
|
android:id="@+id/oc_signin_button"
|
||||||
style="?android:textAppearanceSmall"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
android:text="@string/action_sign_in_short"
|
android:text="@string/action_sign_in_short"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -30,13 +30,13 @@
|
|||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent" >
|
android:layout_height="fill_parent" >
|
||||||
|
|
||||||
<TextView
|
<!--<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
android:text="@string/function_not_available"
|
android:text="@string/function_not_available"
|
||||||
android:id="@+id/textView"
|
android:id="@+id/textView"
|
||||||
android:layout_gravity="center_horizontal"/>
|
android:layout_gravity="center_horizontal"/>-->
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
android:id="@android:id/list"
|
android:id="@android:id/list"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user