Merged in develop (pull request #36)
This commit is contained in:
commit
1b03d1e653
|
@ -7,8 +7,8 @@ android {
|
||||||
applicationId "fr.gouv.etalab.mastodon"
|
applicationId "fr.gouv.etalab.mastodon"
|
||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 25
|
targetSdkVersion 25
|
||||||
versionCode 38
|
versionCode 39
|
||||||
versionName "1.3.9"
|
versionName "1.3.9.1"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
|
|
@ -37,6 +37,8 @@ import com.loopj.android.http.RequestParams;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLEncoder;
|
||||||
import java.security.KeyManagementException;
|
import java.security.KeyManagementException;
|
||||||
import java.security.KeyStoreException;
|
import java.security.KeyStoreException;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
@ -104,12 +106,7 @@ public class LoginActivity extends AppCompatActivity {
|
||||||
connectionButton.setEnabled(false);
|
connectionButton.setEnabled(false);
|
||||||
login_two_step.setVisibility(View.INVISIBLE);
|
login_two_step.setVisibility(View.INVISIBLE);
|
||||||
if (!hasFocus) {
|
if (!hasFocus) {
|
||||||
if( Patterns.WEB_URL.matcher(login_instance.getText().toString().trim()).matches() ){
|
|
||||||
retrievesClientId();
|
retrievesClientId();
|
||||||
}else {
|
|
||||||
Toast.makeText(getApplicationContext(), R.string.toast_error_instance, Toast.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -128,7 +125,11 @@ public class LoginActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private void retrievesClientId(){
|
private void retrievesClientId(){
|
||||||
final Button connectionButton = (Button) findViewById(R.id.login_button);
|
final Button connectionButton = (Button) findViewById(R.id.login_button);
|
||||||
instance = login_instance.getText().toString().trim();
|
try {
|
||||||
|
instance = URLEncoder.encode(login_instance.getText().toString().trim(), "utf-8");
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
Toast.makeText(LoginActivity.this,R.string.client_error, Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
String action = "/api/v1/apps";
|
String action = "/api/v1/apps";
|
||||||
RequestParams parameters = new RequestParams();
|
RequestParams parameters = new RequestParams();
|
||||||
parameters.add(Helper.CLIENT_NAME, Helper.CLIENT_NAME_VALUE);
|
parameters.add(Helper.CLIENT_NAME, Helper.CLIENT_NAME_VALUE);
|
||||||
|
|
Loading…
Reference in New Issue