Skip to content

Commit

Permalink
Merge with widget_conf
Browse files Browse the repository at this point in the history
  • Loading branch information
guilllaumeCritizr committed Feb 15, 2017
2 parents 8f3d420 + 22e3fad commit b0f00d3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 32 deletions.
23 changes: 8 additions & 15 deletions app/src/main/java/com/CritizrSDKExample/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@
import org.json.JSONException;
import org.json.JSONObject;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Objects;

import static android.content.ContentValues.TAG;
import static java.lang.System.in;

public class MainActivity extends Activity implements CritizrListener{

public static final String DEBUG_TAG = "CRITIZR_SDK";
Expand All @@ -38,13 +30,14 @@ public void MainClickMethod(View view) {
String apiKey = this.getResources().getString(R.string.critizr_api_key);

if(view.getId() == R.id.storelocator_btn){
JSONObject object = new JSONObject();
try {
object.put("mode", "feedback");
object.put("user", "guillaume|[email protected]");
} catch (JSONException e) {
e.printStackTrace();
}
JSONObject object = new JSONObject();
try {
object.put("mode", "feedback");
object.put("user", "YXJuYXVkfGFybmF1ZC5sYW5jZWxvdEBjcml0aXpyLmNvbQ=="); // arnaud|[email protected] en BASE64
} catch (JSONException e) {
e.printStackTrace();
}

CritizrSDK.getInstance(apiKey).openFeedbackActivity(this, this, object);
}else if(view.getId() == R.id.my_store_btn){
MainActivity.this.startActivity(new Intent(this, MyStoreActivity.class));
Expand Down
20 changes: 9 additions & 11 deletions app/src/main/java/com/CritizrSDKExample/MyStoreActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,37 @@
import org.json.JSONObject;

public class MyStoreActivity extends Activity implements CritizrListener{

public static final String DEBUG_TAG = "CRITIZR_SDK";

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.my_store_layout);

this.getActionBar().hide();

// /* To get place Rating */
try {
String apiKey = MyStoreActivity.this.getResources().getString(R.string.critizr_api_key);
String externalPlaceId = "velo-paris-xvii";
String externalPlaceId = this.getResources().getString(R.string.external_place_id);
CritizrSDK.getInstance(apiKey).getPlaceRating(externalPlaceId, this);
}catch (Exception e){
e.printStackTrace();
}
}

public void MyStoreClickMethod(View view) {
String apiKey = MyStoreActivity.this.getResources().getString(R.string.critizr_api_key);
if(view.getId() == R.id.storelocator_btn){
CritizrSDK.getInstance(apiKey).openFeedbackActivity(this, this, null);
}else if(view.getId() == R.id.my_store_btn){
JSONObject object = new JSONObject();
try {
object.put("mode", "feedback");
object.put("user", "guillaume|guillaume@critizr.com");
try {
object.put("mode", "feedback");
object.put("user", "YXJuYXVkfGFybmF1ZC5sYW5jZWxvdEBjcml0aXpyLmNvbQ=="); // arnaud|arnaud.lancelot@critizr.com en BASE64
} catch (JSONException e) {
e.printStackTrace();
}
String externalPlaceId = "velo-paris-xvii"; /*External place id I choose for my example - VELO PARIS*/
String externalPlaceId = this.getResources().getString(R.string.external_place_id);
CritizrSDK.getInstance(apiKey).openFeedbackActivity(this, this, externalPlaceId, object);
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<color name="background_color">#BCDC92</color>
<color name="button_color">#0089A5</color>
<color name="background_color">#E8E8E8</color>
<color name="button_color">#B5A78E</color>
<color name="text_color">#45572D</color>
<color name="white_color">#FFFFFF</color>

Expand Down
9 changes: 5 additions & 4 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Bolibio</string>
<string name="app_name">Velo</string>
<string name="critizr_api_key">7f614697ac3524af3ca4ce0df9164caf</string>
<string name="external_place_id">velo-aix-en-provence</string>
<string name="click_here">Cliquer ici</string>
<string name="click_here_to_see_your_store">Accéder à votre page magasin</string>
<string name="send_a_feedback">Envoyer une remarque</string>
<string name="welcome_to_bolibio_france">Bienvenue chez Bolibio France</string>
<string name="bolibio_valencienne">Bolibio Paris XI</string>
<string name="welcome_to_bolibio_france">Bienvenue chez Velo France</string>
<string name="bolibio_valencienne">Velo Aix En Provence</string>
<string name="opening_hours">9h-12h et 14h-19h</string>
<string name="opening_days">Ouvert du lundi au samedi</string>
<string name="contact_director">Contacter le gérant</string>
<string name="contact_another_director">Pour contacter le gérant d\'un autre magasin :</string>
</resources>
</resources>

0 comments on commit b0f00d3

Please sign in to comment.