diff --git a/app/build.gradle b/app/build.gradle index 89fbfe2..879cfcb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "com.arastta" minSdkVersion 15 targetSdkVersion 23 - versionCode 7 - versionName "1.0.7" + versionCode 8 + versionName "1.0.8" } buildTypes { release { diff --git a/app/src/main/java/com/arastta/AppWidgetSettings.java b/app/src/main/java/com/arastta/AppWidgetSettings.java index b312dc5..fd9d05d 100644 --- a/app/src/main/java/com/arastta/AppWidgetSettings.java +++ b/app/src/main/java/com/arastta/AppWidgetSettings.java @@ -397,10 +397,14 @@ public void onItemSelected(AdapterView parent, View view, int position, long e.printStackTrace(); } + if(!url.startsWith("http"))url = "http://" + url;//TODO XXX + saveTitlePref(context, "url", mAppWidgetId, url); saveTitlePref(context, "username", mAppWidgetId, username); saveTitlePref(context, "password", mAppWidgetId, password); + new getOrderStatuses().execute(); + if(Working)db.cancel(true); db = new getDashboard(); db.execute(); @@ -458,6 +462,8 @@ public void loadStores() username = jsonArray.getJSONObject(i).getString("username"); password = jsonArray.getJSONObject(i).getString("password"); + if(!url.startsWith("http"))url = "http://" + url;//TODO XXX + saveTitlePref(context, "url", mAppWidgetId, url); saveTitlePref(context, "username", mAppWidgetId, username); saveTitlePref(context, "password", mAppWidgetId, password); @@ -489,22 +495,24 @@ public View getDropDownView(int position, View convertView, ViewGroup parent) WidgetSettingsSpinnerStore.setSelection(store_id); - if(store_id == 0) { url = jsonArray.getJSONObject(0).getString("store_url"); username = jsonArray.getJSONObject(0).getString("username"); password = jsonArray.getJSONObject(0).getString("password"); + if(!url.startsWith("http"))url = "http://" + url;//TODO XXX + saveTitlePref(context, "url", mAppWidgetId, url); saveTitlePref(context, "username", mAppWidgetId, username); saveTitlePref(context, "password", mAppWidgetId, password); } + new getOrderStatuses().execute(); + + if(Working)db.cancel(true); db = new getDashboard(); db.execute(); - - new getOrderStatuses().execute(); } catch (JSONException e) { @@ -725,5 +733,4 @@ void setTextBox() WidgetSettingsTextStatus.setText(texts); } -} - +} \ No newline at end of file diff --git a/app/src/main/java/com/arastta/ConstantsAndFunctions.java b/app/src/main/java/com/arastta/ConstantsAndFunctions.java index 56dc7d1..f0cec2d 100644 --- a/app/src/main/java/com/arastta/ConstantsAndFunctions.java +++ b/app/src/main/java/com/arastta/ConstantsAndFunctions.java @@ -189,6 +189,8 @@ public static String getHtml(String username, String password, String xUrl, Stri String link = xUrl+"/index.php/api/"+functions; Log.e("getHtml", link); + if(!link.startsWith("http"))link = "http://" + link;//TODO XXX + StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy); diff --git a/app/src/main/java/com/arastta/MasterActivity.java b/app/src/main/java/com/arastta/MasterActivity.java index a0c879e..8efa67c 100644 --- a/app/src/main/java/com/arastta/MasterActivity.java +++ b/app/src/main/java/com/arastta/MasterActivity.java @@ -513,7 +513,9 @@ public void loadStore() username = activeStore.getString("username"); password = activeStore.getString("password"); - String avatarUrl = activeStore.getString("store_url") +"/"+ activeStore.getString("config_image"); + if(!url.startsWith("http"))url = "http://" + url;//TODO XXX + + String avatarUrl = url +"/"+ activeStore.getString("config_image"); ImageOptions avatarOptions = new ImageOptions(); //avatarOptions.round = 999;