Skip to content
This repository has been archived by the owner on Apr 26, 2022. It is now read-only.

Commit

Permalink
Widget Eklendi.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkarakilic committed Nov 14, 2016
1 parent 986f82d commit db2ed00
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
17 changes: 12 additions & 5 deletions app/src/main/java/com/arastta/AppWidgetSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -725,5 +733,4 @@ void setTextBox()
WidgetSettingsTextStatus.setText(texts);
}

}

}
2 changes: 2 additions & 0 deletions app/src/main/java/com/arastta/ConstantsAndFunctions.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/com/arastta/MasterActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit db2ed00

Please sign in to comment.