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