Permalink
Browse files

Update url paths so user does not get 404 error at startup, And add q…

…uick search for other user
  • Loading branch information...
1 parent 9d4d265 commit f920e37e668d30c2a477c3ceff17a3622b9c6415 @voidcode committed Feb 11, 2012
Showing with 87 additions and 99 deletions.
  1. +1 −2 .settings/org.eclipse.core.resources.prefs
  2. +6 −0 AndroidManifest.xml
  3. BIN bin/Diaspora-Webclient.apk
  4. BIN bin/classes.dex
  5. BIN bin/classes/com/voidcode/diasporawebclient/MainActivity$1.class
  6. BIN bin/classes/com/voidcode/diasporawebclient/MainActivity$2.class
  7. BIN bin/classes/com/voidcode/diasporawebclient/MainActivity$3.class
  8. BIN bin/classes/com/voidcode/diasporawebclient/MainActivity$4.class
  9. BIN bin/classes/com/voidcode/diasporawebclient/MainActivity.class
  10. BIN bin/classes/com/voidcode/diasporawebclient/PodSettingsActivity$1.class
  11. BIN bin/classes/com/voidcode/diasporawebclient/PodSettingsActivity$2.class
  12. BIN bin/classes/com/voidcode/diasporawebclient/PodSettingsActivity$3.class
  13. BIN bin/classes/com/voidcode/diasporawebclient/PodSettingsActivity.class
  14. BIN bin/classes/com/voidcode/diasporawebclient/R$drawable.class
  15. BIN bin/classes/com/voidcode/diasporawebclient/R$id.class
  16. BIN bin/classes/com/voidcode/diasporawebclient/R$layout.class
  17. BIN bin/classes/com/voidcode/diasporawebclient/R$menu.class
  18. BIN bin/classes/com/voidcode/diasporawebclient/R$string.class
  19. BIN bin/classes/com/voidcode/diasporawebclient/R$style.class
  20. BIN bin/classes/com/voidcode/diasporawebclient/R$xml.class
  21. BIN bin/classes/com/voidcode/diasporawebclient/SetupInternetActivity.class
  22. BIN bin/classes/com/voidcode/diasporawebclient/TranslateActivity$1.class
  23. BIN bin/classes/com/voidcode/diasporawebclient/TranslateActivity.class
  24. BIN bin/resources.ap_
  25. +40 −42 gen/com/voidcode/diasporawebclient/R.java
  26. +1 −1 res/layout/main.xml
  27. +6 −4 res/layout/translate.xml
  28. +0 −1 res/menu/main_menu.xml
  29. +8 −8 res/values/strings.xml
  30. +23 −18 src/com/voidcode/diasporawebclient/MainActivity.java
  31. +1 −21 src/com/voidcode/diasporawebclient/PodSettingsActivity.java
  32. +1 −0 src/com/voidcode/diasporawebclient/SetupInternetActivity.java
  33. +0 −2 src/com/voidcode/diasporawebclient/TranslateActivity.java
@@ -1,4 +1,3 @@
-#Fri Dec 16 10:42:37 CET 2011
+#Wed Feb 08 21:56:38 CET 2012
eclipse.preferences.version=1
-encoding//assets/donation.html=UTF-8
encoding//assets/tips.html=UTF-8
View
@@ -55,5 +55,11 @@
android:name="android.appwidget.provider"
android:resource="@xml/widget_provider" />
</receiver>
+ <receiver android:name=".receiver.ConnectionChangeReceiver"
+ android:label="NetworkConnection">
+ <intent-filter>
+ <action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
+ </intent-filter>
+ </receiver>
</application>
</manifest>
View
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
@@ -15,20 +15,19 @@
public static final int ic_launcher=0x7f020001;
public static final int ic_menu_aspects=0x7f020002;
public static final int ic_menu_contacts=0x7f020003;
- public static final int ic_menu_donation=0x7f020004;
- public static final int ic_menu_exit=0x7f020005;
- public static final int ic_menu_home=0x7f020006;
- public static final int ic_menu_invite=0x7f020007;
- public static final int ic_menu_messages=0x7f020008;
- public static final int ic_menu_notifications=0x7f020009;
- public static final int ic_menu_podsettings=0x7f02000a;
- public static final int ic_menu_profile=0x7f02000b;
- public static final int ic_menu_search=0x7f02000c;
- public static final int ic_menu_share=0x7f02000d;
- public static final int ic_menu_tips=0x7f02000e;
- public static final int ic_menu_translate=0x7f02000f;
- public static final int topmenu=0x7f020010;
- public static final int topmenu_repeat=0x7f020011;
+ public static final int ic_menu_exit=0x7f020004;
+ public static final int ic_menu_home=0x7f020005;
+ public static final int ic_menu_invite=0x7f020006;
+ public static final int ic_menu_messages=0x7f020007;
+ public static final int ic_menu_notifications=0x7f020008;
+ public static final int ic_menu_podsettings=0x7f020009;
+ public static final int ic_menu_profile=0x7f02000a;
+ public static final int ic_menu_search=0x7f02000b;
+ public static final int ic_menu_share=0x7f02000c;
+ public static final int ic_menu_tips=0x7f02000d;
+ public static final int ic_menu_translate=0x7f02000e;
+ public static final int topmenu=0x7f02000f;
+ public static final int topmenu_repeat=0x7f020010;
}
public static final class id {
public static final int button1=0x7f080016;
@@ -41,8 +40,7 @@
public static final int imageView1=0x7f080007;
public static final int linearLayout1=0x7f080018;
public static final int listView_poduptime=0x7f08000b;
- public static final int mainmenu_donation=0x7f08001f;
- public static final int mainmenu_exit=0x7f080020;
+ public static final int mainmenu_exit=0x7f08001f;
public static final int mainmenu_podsettings=0x7f08001d;
public static final int mainmenu_share=0x7f08001b;
public static final int mainmenu_tips=0x7f08001e;
@@ -77,44 +75,44 @@
}
public static final class string {
public static final int app_name=0x7f050000;
- public static final int findtag=0x7f05001f;
- public static final int findtag_alert_title=0x7f05001d;
- public static final int findtag_alert_validate_needsomedata=0x7f05001e;
- public static final int findtag_button=0x7f05001c;
- public static final int findtag_h1=0x7f05001a;
- public static final int findtag_p=0x7f05001b;
- public static final int menu_aspects=0x7f05000c;
- public static final int menu_contacts=0x7f050008;
- public static final int menu_donation=0x7f050006;
- public static final int menu_exit=0x7f05000e;
+ public static final int menu_aspects=0x7f05000b;
+ public static final int menu_contacts=0x7f050007;
+ public static final int menu_exit=0x7f05000d;
public static final int menu_findtag=0x7f050003;
public static final int menu_home=0x7f050001;
- public static final int menu_invite=0x7f05000d;
- public static final int menu_messages=0x7f05000a;
- public static final int menu_notifications=0x7f050009;
+ public static final int menu_invite=0x7f05000c;
+ public static final int menu_messages=0x7f050009;
+ public static final int menu_notifications=0x7f050008;
public static final int menu_podsettings=0x7f050004;
- public static final int menu_profile=0x7f05000b;
+ public static final int menu_profile=0x7f05000a;
public static final int menu_share=0x7f050002;
public static final int menu_tips=0x7f050005;
- public static final int menu_translate=0x7f050007;
+ public static final int menu_translate=0x7f050006;
public static final int podsettings_button_close=0x7f050020;
- public static final int podsettings_button_save=0x7f050015;
- public static final int podsettings_currentpod=0x7f050011;
- public static final int podsettings_dialog_text=0x7f050013;
- public static final int podsettings_dialog_title=0x7f050012;
- public static final int podsettings_h1=0x7f05000f;
- public static final int podsettings_text_currentpod=0x7f050010;
- public static final int setupinternet_button=0x7f050019;
- public static final int setupinternet_button_wirelesssettings=0x7f050018;
- public static final int setupinternet_h1=0x7f050016;
- public static final int setupinternet_text=0x7f050017;
+ public static final int podsettings_button_save=0x7f050014;
+ public static final int podsettings_currentpod=0x7f050010;
+ public static final int podsettings_dialog_text=0x7f050012;
+ public static final int podsettings_dialog_title=0x7f050011;
+ public static final int podsettings_h1=0x7f05000e;
+ public static final int podsettings_text_currentpod=0x7f05000f;
+ public static final int search=0x7f05001f;
+ public static final int search_alert_bypeople_validate_needsomedata=0x7f05001d;
+ public static final int search_alert_bytags_validate_needsomedata=0x7f05001e;
+ public static final int search_alert_title=0x7f05001c;
+ public static final int search_button=0x7f05001b;
+ public static final int search_h1=0x7f050019;
+ public static final int search_p=0x7f05001a;
+ public static final int setupinternet_button=0x7f050018;
+ public static final int setupinternet_button_wirelesssettings=0x7f050017;
+ public static final int setupinternet_h1=0x7f050015;
+ public static final int setupinternet_text=0x7f050016;
public static final int translate_button_howto_obtain_googletranslatekey=0x7f050026;
public static final int translate_button_linkto_googleapiconsole=0x7f050024;
public static final int translate_button_text=0x7f050023;
public static final int translate_chooselanguage_h1=0x7f050021;
public static final int translate_googlekey_h1=0x7f050022;
public static final int translate_howto_text=0x7f050025;
- public static final int widget_button_share=0x7f050014;
+ public static final int widget_button_share=0x7f050013;
}
public static final class style {
public static final int widgetimagesbutton=0x7f060000;
View
@@ -35,7 +35,7 @@
android:src="@drawable/ic_menu_home" />
<ImageButton
- android:onClick="onclick_findtag"
+ android:onClick="onclick_search"
android:id="@+id/imageButton4"
android:layout_width="wrap_content"
android:background="@null"
View
@@ -12,8 +12,8 @@
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:src="@drawable/topmenu" />
-
+ android:src="@drawable/topmenu" />
+
<TextView
android:id="@+id/textView3"
android:layout_width="fill_parent"
@@ -25,7 +25,8 @@
<Spinner
android:id="@+id/translate_spinner_language"
android:layout_width="fill_parent"
- android:layout_height="wrap_content" />
+ android:layout_height="wrap_content" />
+
<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
@@ -54,7 +55,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/translate_howto_text"
- android:textAppearance="?android:attr/textAppearanceSmall" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
+
<Button
android:id="@+id/button2"
android:layout_width="fill_parent"
View
@@ -4,6 +4,5 @@
<item android:id="@+id/mainmenu_translate" android:icon="@drawable/ic_menu_translate" android:title="@string/menu_translate" />
<item android:id="@+id/mainmenu_podsettings" android:icon="@drawable/ic_menu_podsettings" android:title="@string/menu_podsettings" />
<item android:id="@+id/mainmenu_tips" android:icon="@drawable/ic_menu_tips" android:title="@string/menu_tips" />
- <item android:id="@+id/mainmenu_donation" android:icon="@drawable/ic_menu_donation" android:title="@string/menu_donation" />
<item android:id="@+id/mainmenu_exit" android:icon="@drawable/ic_menu_exit" android:title="@string/menu_exit" />
</menu>
View
@@ -7,7 +7,6 @@
<string name="menu_findtag">Find tag</string>
<string name="menu_podsettings">PodSettings</string>
<string name="menu_tips">Tips</string>
- <string name="menu_donation">Donation</string>
<string name="menu_translate">Translate</string>
<string name="menu_contacts">Contacts</string>
<string name="menu_notifications">Notifications</string>
@@ -34,12 +33,13 @@
<string name="setupinternet_text">This app require a internet connection!</string>
<string name="setupinternet_button_wirelesssettings">Wireless settings</string>
<string name="setupinternet_button">Close</string>
- <string name="findtag_h1">Findtag</string>
- <string name="findtag_p">Type a word and see what the stream contains</string>
- <string name="findtag_button">See it´s stream</string>
- <string name="findtag_alert_title">Search by #tag</string>
- <string name="findtag_alert_validate_needsomedata">Try to add a tag like: #newhere or #art</string>
- <string name="findtag" >findtag</string>
+ <string name="search_h1">Findtag</string>
+ <string name="search_p">Type a word and see what the stream contains</string>
+ <string name="search_button">See it´s stream</string>
+ <string name="search_alert_title">Search</string>
+ <string name="search_alert_bypeople_validate_needsomedata">Please add a name</string>
+ <string name="search_alert_bytags_validate_needsomedata">Try to add a tag like: #newhere or #art</string>
+ <string name="search" >findtag</string>
<string name="podsettings_button_close">Ok</string>
@@ -48,6 +48,6 @@
<string name="translate_googlekey_h1">Add your translate api-key here.</string>
<string name="translate_button_text">Use this key</string>
<string name="translate_button_linkto_googleapiconsole">Google api console</string>
- <string name="translate_howto_text">You can use Microsoft-translator for free, just type microsoft-translator as your api-key. You can use Google Translate API v2, this is based on usage(payment). Translation usage is calculated in millions of characters (M), where 1 M = 10^6 characters. Important: Google Translate API v2 requires billing information for all accounts before you can start using the service. To sign up for billing, sign in to the Google APIs console and click the Billing tab. 1 M characters of text = $20.</string>
+ <string name="translate_howto_text">You can use Microsoft-translator for free, just type microsoft-translator as your api-key. You can use Google Translate(payment). Translation usage is calculated in millions of characters (M), where 1 M = 10^6 characters = $20. Important: this requires billing information before you can start using the service. To sign up for billing, sign in to the Google APIs console and click the Billing tab.</string>
<string name="translate_button_howto_obtain_googletranslatekey">See how you obtain the Google Translate Key</string>
</resources>
@@ -8,7 +8,6 @@
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
-import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
@@ -69,11 +68,10 @@ public void onCreate(Bundle savedInstanceState) {
//see: https://github.com/voidcode/Diaspora-Webclient/issues/2
mWeb.setWebChromeClient(new WebChromeClient() {
public boolean onJsAlert(WebView view, String url, String message, JsResult result)
- {
- return super.onJsAlert(view, url, message, result);
+ {
+ return super.onJsAlert(view, url, message, result);
}
});
-
// load main domain´s rooturl
SharedPreferences preferences = getSharedPreferences(SETTINGS_FILENAME, MODE_PRIVATE);
this.main_domain = preferences.getString("currentpod", "");
@@ -87,7 +85,7 @@ public boolean onJsAlert(WebView view, String url, String message, JsResult resu
else
{
// goto users stream
- startDiasporaBrowser("/stream");
+ startDiasporaBrowser("/explore");
Toast.makeText(getApplicationContext(), "Pod: "+main_domain, Toast.LENGTH_SHORT).show();
}
}
@@ -103,7 +101,7 @@ public boolean userHasEnableTranslate()
{
// load google-api-key
SharedPreferences preferences = getSharedPreferences("translate_settings", MODE_PRIVATE);
- String googleapikey = preferences.getString("googleapikey", "microsoft-translator");
+ String googleapikey = preferences.getString("googleapikey", "");
if(!googleapikey.equals(""))//if user has added a google-api-key
return true;
else if(googleapikey.toLowerCase().equals("microsoft-translator"))
@@ -113,7 +111,7 @@ else if(googleapikey.toLowerCase().equals("microsoft-translator"))
}
public void onclick_stream(View v)
{
- startDiasporaBrowser("/stream");
+ startDiasporaBrowser("/explore");//goto start or logon pages
}
public void onclick_share(View v)
{
@@ -124,31 +122,41 @@ public void onclick_contacts(View v)
startDiasporaBrowser("/contacts");
}
- public void onclick_findtag(View v)
+ public void onclick_search(View v)
{
final AlertDialog.Builder alert = new AlertDialog.Builder(this);
final EditText input = new EditText(this);
alert.setView(input);
- alert.setTitle(R.string.findtag_alert_title);
- alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
+ alert.setTitle(R.string.search_alert_title);
+ alert.setPositiveButton("By people", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
String inputtag = input.getText().toString().trim();
// this validate the input data for tagfind
if(inputtag.equals("") || inputtag.equals(null))
{
dialog.cancel(); // if user don´t have added a tag
- Toast.makeText(getApplicationContext(), R.string.findtag_alert_validate_needsomedata, Toast.LENGTH_LONG).show();
+ Toast.makeText(getApplicationContext(), R.string.search_alert_bypeople_validate_needsomedata, Toast.LENGTH_LONG).show();
}
else // if user have added a search tag
{
- startDiasporaBrowser("/tags/"+inputtag);
+ startDiasporaBrowser("/people.mobile?q="+inputtag);
}
}
});
- alert.setNegativeButton("Cancel",
+ alert.setNegativeButton("By tags",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
- dialog.cancel();
+ String inputtag = input.getText().toString().trim();
+ // this validate the input data for tagfind
+ if(inputtag.equals("") || inputtag.equals(null))
+ {
+ dialog.cancel(); // if user don´t have added a tag
+ Toast.makeText(getApplicationContext(), R.string.search_alert_bytags_validate_needsomedata, Toast.LENGTH_LONG).show();
+ }
+ else // if user have added a search tag
+ {
+ startDiasporaBrowser("/tags/"+inputtag);
+ }
}
});
alert.show();
@@ -262,9 +270,6 @@ public boolean onOptionsItemSelected(MenuItem item) {
return true;
case R.id.mainmenu_tips:
mWeb.loadUrl("file:///android_asset/tips.html");
- return true;
- case R.id.mainmenu_donation:
- mWeb.loadUrl("file:///android_asset/donation.html");
return true;
case R.id.mainmenu_exit:
this.finish();
@@ -275,7 +280,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
}
private boolean isNetworkAvailable()
{
- ConnectivityManager connec = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
+ ConnectivityManager connec = (ConnectivityManager)getSystemService(CONNECTIVITY_SERVICE);
NetworkInfo mobileInfo = connec.getNetworkInfo(0);
NetworkInfo wifiInfo = connec.getNetworkInfo(1);
NetworkInfo wimaxInfo = connec.getNetworkInfo(6);
@@ -1,25 +1,13 @@
package com.voidcode.diasporawebclient;
-import java.io.BufferedReader;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionException;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
-import org.apache.http.StatusLine;
-import org.apache.http.client.ClientProtocolException;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONArray;
-import org.json.JSONObject;
import android.app.Activity;
import android.app.AlertDialog;
-import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -50,9 +38,6 @@
public void onCreate(Bundle savedInstanceState) {
if(isNetworkAvailable())
{
-
-
-
try {
//load pods from poduptime.me as a AsyncTask
@@ -124,12 +109,7 @@ public void afterTextChanged(Editable s)
} catch (ExecutionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- }
-
-
-
-
-
+ }
}
else //user have NO internet
{
@@ -18,6 +18,7 @@ public void onCreate(Bundle savedInstanceState) {
}
public void onclick_button_wireless_settings(View v)
{
+ //show/ open wireless settings
startActivity( new Intent(Settings.ACTION_WIRELESS_SETTINGS));
}
public void onclick_button_close(View v)
Oops, something went wrong.

0 comments on commit f920e37

Please sign in to comment.