Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bug fix

  • Loading branch information...
commit 9c2df6fb22ca42c5166187641be8aecc1156de07 1 parent 3bfe8e0
Codeskraps authored
View
4 AndroidManifest.xml
@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.codeskraps.lolo"
- android:versionCode="20"
- android:versionName="2.0" >
+ android:versionCode="21"
+ android:versionName="2.1" >
<!-- Remember to update the info code version -->
View
10 README.rdoc
@@ -4,8 +4,8 @@
* <b>Git:</b> https://github.com/091labs/lo-lo
* <b>Author:</b> 091 Labs members
* <b>License:</b> GNU GPL v3
-* <b>Latest Version:</b> 1.18
-* <b>Release Date:</b> 2012
+* <b>Latest Version:</b> 2.0
+* <b>Release Date:</b> 2013
== General Infromation
@@ -31,6 +31,12 @@ Install from Google Play
* http://play.google.com/store/apps/details?id=com.codeskraps.lolo
== ChangeLog
+<b>v2.1</b>
+* Bug Fix
+
+<b>v2.0</b>
+* New, Post tweets to Twitter
+
<b>v1.18</b>
* Changed initial image of widget to no signal
View
2  res/values/strings.xml
@@ -48,7 +48,7 @@
</string-array>
<string name="prefsCat_Info">Information</string>
- <string name="prefsInfo_Title">091 Labs lo-lo v2.0</string>
+ <string name="prefsInfo_Title">091 Labs lo-lo v2.1</string>
<string name="prefsInfo_summary">GNU GPL License v3 &#8211; 2013</string>
<!-- WordPress Acount -->
View
55 src/com/codeskraps/lolo/twitter/TwitterSignInActivity.java
@@ -21,6 +21,7 @@
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
+import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
@@ -43,6 +44,7 @@ protected void onCreate(Bundle savedInstanceState) {
.apiSecret("vLLTqO311ZhlVXhl1GaB72DnIwdCOPwzeozNRWy3I").build();
new OathTask().execute(STEP.zero);
+ requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
getActionBar().setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.twitter_signin);
@@ -57,22 +59,31 @@ public void onClick(View v) {
// @formatter:off
switch (v.getId()) {
case R.id.twi_btn_goto: new OathTask().execute(STEP.one); break;
- case R.id.twi_submit: new OathTask().execute(STEP.two); break;
+ case R.id.twi_submit:
+ ((Button) findViewById(R.id.twi_submit)).setOnClickListener(this);
+ new OathTask().execute(STEP.two);
+ break;
case R.id.twi_cancel: finish(); break;
// @formatter:on
}
}
- private class OathTask extends AsyncTask<STEP, Void, Void> {
+ private class OathTask extends AsyncTask<STEP, Void, Boolean> {
@Override
- protected Void doInBackground(STEP... params) {
+ protected void onPreExecute() {
+ super.onPreExecute();
+ setProgressBarIndeterminateVisibility(Boolean.TRUE);
+ }
+
+ @Override
+ protected Boolean doInBackground(STEP... params) {
STEP step = params[0];
if (step == STEP.zero) {
requestToken = service.getRequestToken();
- }
- if (step == STEP.one) {
+
+ } else if (step == STEP.one) {
String token = service.getAuthorizationUrl(requestToken);
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(token));
@@ -95,21 +106,33 @@ protected Void doInBackground(STEP... params) {
editor.commit();
TwitterSignInActivity.this.finish();
+ return false;
} catch (Exception e) {
- new AlertDialog.Builder(TwitterSignInActivity.this)
- .setIcon(R.drawable.alerts_and_states_error)
- .setMessage(R.string.twi_dia_message)
- .setTitle(R.string.twi_dia_title)
- .setPositiveButton(R.string.twi_dia_ok,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- dialog.dismiss();
- }
- }).create().show();
+ Log.i(TAG, "Handled: twitter key - " + e.getMessage(), e);
+ return true;
}
}
- return null;
+ return false;
+ }
+
+ @Override
+ protected void onPostExecute(Boolean result) {
+ super.onPostExecute(result);
+
+ setProgressBarIndeterminateVisibility(Boolean.FALSE);
+
+ if (result)
+ new AlertDialog.Builder(TwitterSignInActivity.this)
+ .setIcon(R.drawable.alerts_and_states_error)
+ .setMessage(R.string.twi_dia_message)
+ .setTitle(R.string.twi_dia_title)
+ .setPositiveButton(R.string.twi_dia_ok,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int id) {
+ dialog.dismiss();
+ }
+ }).create().show();
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.