Skip to content

Commit

Permalink
Remise à niveau du sdk android.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-PhilippeDESCAMPS committed May 23, 2016
1 parent 930445d commit eccc73a
Show file tree
Hide file tree
Showing 12 changed files with 258 additions and 247 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ repositories {

dependencies {
compile 'com.android.support:support-v4:23.1.1'
compile 'com.critizr:critizr-sdk:1.0.0'
compile(name:'critizr-sdk', ext:'aar')
}
Binary file added app/libs/critizr-sdk.aar
Binary file not shown.
28 changes: 16 additions & 12 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.CritizrSDKExample"
xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
android:versionName="1.0">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="18" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme" >
<activity
android:name="com.CritizrSDKExample.MainActivity"
android:label="@string/app_name">
android:label="@string/app_name"
>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name="MyStoreActivity"/>
<activity android:name="com.CritizrSDK.CritizrActivity"/>

</application>

</manifest>
69 changes: 37 additions & 32 deletions app/src/main/java/com/CritizrSDKExample/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.CritizrSDKExample;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
Expand All @@ -9,36 +10,40 @@
import com.CritizrSDK.CritizrListener;
import com.CritizrSDK.CritizrSDK;

public class MainActivity extends Activity implements CritizrListener {

public static final String DEBUG_TAG = "CRITIZR_SDK";

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

this.getActionBar().hide();
}

public void MainClickMethod(View view) {
String apiKey = this.getResources().getString(R.string.critizr_api_key);

if (view.getId() == R.id.storelocator_btn) {
CritizrSDK.getInstance(apiKey).openFeedbackActivity(this, this);
} else if (view.getId() == R.id.my_store_btn) {
MainActivity.this.startActivity(new Intent(this, MyStoreActivity.class));
}
}

@Override
public void onFeedbackSent() {
Log.d(DEBUG_TAG, "Feedback sent");
}

@Override
public void onRatingResult(double arg0) {
// TODO Auto-generated method stub

}
public class MainActivity extends Activity implements CritizrListener{

public static final String DEBUG_TAG = "CRITIZR_SDK";

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

this.getActionBar().hide();
}


public void MainClickMethod(View view) {
String apiKey = this.getResources().getString(R.string.critizr_api_key);

if(view.getId() == R.id.storelocator_btn){
CritizrSDK.getInstance(apiKey).openFeedbackActivity(this, this);
}else if(view.getId() == R.id.my_store_btn){
MainActivity.this.startActivity(new Intent(this, MyStoreActivity.class));
}

}

@Override
public void onFeedbackSent() {
Log.d(DEBUG_TAG, "Feedback sent");
}


@Override
public void onRatingResult(double arg0) {
// TODO Auto-generated method stub

}

}
72 changes: 37 additions & 35 deletions app/src/main/java/com/CritizrSDKExample/MyStoreActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,42 @@
import com.CritizrSDK.CritizrListener;
import com.CritizrSDK.CritizrSDK;

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();

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 */
String apiKey = MyStoreActivity.this.getResources().getString(R.string.critizr_api_key);
String externalPlaceId = "12";
CritizrSDK.getInstance(apiKey).getPlaceRating(externalPlaceId, this);
}

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);
} else if (view.getId() == R.id.my_store_btn) {
String externalPlaceId = "12"; /*External place id I choose for my example - Bolibio Valencienne*/
CritizrSDK.getInstance(apiKey).openFeedbackActivity(this, this, externalPlaceId);
}
}

@Override
public void onFeedbackSent() {
Log.d(DEBUG_TAG, "Feedback sent");
}

@Override
public void onRatingResult(double rating) {
Log.d(DEBUG_TAG, "Place Rating is " + rating);
}
String apiKey = MyStoreActivity.this.getResources().getString(R.string.critizr_api_key);
String externalPlaceId = "12";
CritizrSDK.getInstance(apiKey).getPlaceRating(externalPlaceId, this);
}

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);

}else if(view.getId() == R.id.my_store_btn){
String externalPlaceId = "12"; /*External place id I choose for my example - Bolibio Valencienne*/
CritizrSDK.getInstance(apiKey).openFeedbackActivity(this, this, externalPlaceId);
}
}

@Override
public void onFeedbackSent() {
Log.d(DEBUG_TAG, "Feedback sent");

}

@Override
public void onRatingResult(double rating) {
Log.d(DEBUG_TAG, "Place Rating is "+rating);
}
}
118 changes: 59 additions & 59 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background_color">

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_marginBottom="70dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="60dp"
>

<TextView
android:id="@+id/widget_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/welcome_to_bolibio_france"
android:textColor="@color/text_color"
android:textSize="24sp"
/>

<Button
android:id="@+id/storelocator_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/widget_tv"
android:layout_marginTop="50dp"
android:background="@color/button_color"
android:onClick="MainClickMethod"
android:text="@string/send_a_feedback"
android:textColor="@color/white_color"
android:textSize="18sp"/>

</RelativeLayout>

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="60dp"
android:layout_alignParentBottom="true"
>

<TextView
android:id="@+id/my_store_btn"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentRight="true"
android:background="@color/button_color"
android:clickable="true"
android:gravity="center"
android:onClick="MainClickMethod"
android:text="@string/click_here_to_see_your_store"
android:textColor="@color/white_color"
android:textSize="18sp"/>

</RelativeLayout>

android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background_color">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="70dp"
android:layout_marginTop="60dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_alignParentTop="true"
>

<TextView
android:id="@+id/widget_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/text_color"
android:gravity="center"
android:textSize="24sp"
android:text="@string/welcome_to_bolibio_france"
/>
<Button
android:id="@+id/storelocator_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="MainClickMethod"
android:textColor="@color/white_color"
android:background="@color/button_color"
android:textSize="18sp"
android:layout_below="@+id/widget_tv"
android:layout_marginTop="50dp"
android:text="@string/send_a_feedback" />
</RelativeLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="60dp"
android:layout_alignParentBottom="true"
>
<TextView
android:id="@+id/my_store_btn"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:onClick="MainClickMethod"
android:clickable="true"
android:layout_alignParentRight="true"
android:textColor="@color/white_color"
android:background="@color/button_color"
android:textSize="18sp"
android:gravity="center"
android:text="@string/click_here_to_see_your_store" />
</RelativeLayout>
</RelativeLayout>
Loading

0 comments on commit eccc73a

Please sign in to comment.