-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
…eliver SDk
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 25 | ||
buildToolsVersion "25.0.3" | ||
defaultConfig { | ||
applicationId "com.customer" | ||
minSdkVersion 14 | ||
targetSdkVersion 25 | ||
versionCode 1 | ||
versionName "1.0" | ||
multiDexEnabled true | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
|
||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
compile 'com.android.support:appcompat-v7:25.3.1' | ||
compile 'com.android.support.constraint:constraint-layout:1.0.2' | ||
compile 'com.android.support:design:25.3.1' | ||
compile 'com.android.support:support-v4:25.3.1' | ||
compile 'com.android.support:multidex:1.0.1' | ||
compile 'com.android.support:cardview-v7:25.3.1' | ||
compile 'com.github.bumptech.glide:glide:3.7.0' | ||
compile 'com.teliver.sdk:TeliverSdk:1.0.7' | ||
} | ||
apply plugin: 'com.google.gms.google-services' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in /home/selva/Android/Sdk/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.customer"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | ||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | ||
|
||
<application | ||
android:name=".Application" | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name=".activities.ActivityTracking" | ||
android:screenOrientation="portrait"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
<activity android:name=".activities.ActivityHome" | ||
android:screenOrientation="portrait"/> | ||
|
||
<service android:name=".FirebaseMessaging"> | ||
<intent-filter> | ||
<action android:name="com.google.firebase.MESSAGING_EVENT" /> | ||
</intent-filter> | ||
</service> | ||
|
||
|
||
</application> | ||
|
||
</manifest> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package com.customer; | ||
|
||
import android.support.v7.widget.RecyclerView; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.ImageView; | ||
import android.widget.TextView; | ||
|
||
import java.util.ArrayList; | ||
|
||
|
||
public class AdapterCartItems extends RecyclerView.Adapter<AdapterCartItems.ViewHolder> { | ||
|
||
private ArrayList<Model> list = new ArrayList<>(); | ||
|
||
|
||
@Override | ||
public AdapterCartItems.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.layout_cart_items, parent, false); | ||
return new ViewHolder(view); | ||
} | ||
|
||
@Override | ||
public void onBindViewHolder(final AdapterCartItems.ViewHolder holder, final int position) { | ||
Model model = list.get(position); | ||
holder.txtName.setText(model.getName()); | ||
holder.txtItemPrice.setText(model.getItemPrice()); | ||
holder.txtFinalPrice.setText("₹" + model.getFinalPrice()); | ||
holder.img.setImageResource(model.getIcon()); | ||
holder.txtQuantity.setText(model.getQuantity()); | ||
} | ||
|
||
@Override | ||
public int getItemCount() { | ||
return list.size(); | ||
} | ||
|
||
public void setData(ArrayList<Model> listCartItems) { | ||
this.list = listCartItems; | ||
|
||
} | ||
|
||
|
||
class ViewHolder extends RecyclerView.ViewHolder { | ||
|
||
private TextView txtName, txtFinalPrice, txtItemPrice, txtQuantity; | ||
|
||
private ImageView img; | ||
|
||
private ViewHolder(View itemView) { | ||
super(itemView); | ||
txtName = (TextView) itemView.findViewById(R.id.txtName); | ||
txtItemPrice = (TextView) itemView.findViewById(R.id.txtItemPrice); | ||
txtFinalPrice = (TextView) itemView.findViewById(R.id.txtFinalPrice); | ||
img = (ImageView) itemView.findViewById(R.id.imgFirstItem); | ||
txtQuantity = (TextView) itemView.findViewById(R.id.txtQuantity); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.customer; | ||
|
||
import android.content.SharedPreferences; | ||
import android.support.multidex.MultiDexApplication; | ||
|
||
import com.teliver.sdk.core.Teliver; | ||
|
||
public class Application extends MultiDexApplication { | ||
|
||
|
||
private SharedPreferences sharedPreferences; | ||
|
||
private SharedPreferences.Editor editor; | ||
|
||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
Teliver.init(this,"your_teliver_key"); | ||
sharedPreferences = getSharedPreferences(getString(R.string.app_name), MODE_PRIVATE); | ||
editor = sharedPreferences.edit(); | ||
editor.apply(); | ||
} | ||
|
||
public void storeStringInPref(String key, String value) { | ||
editor.putString(key, value); | ||
editor.commit(); | ||
} | ||
|
||
public void storeBooleanInPref(String key, boolean value) { | ||
editor.putBoolean(key, value); | ||
editor.commit(); | ||
} | ||
|
||
public String getStringInPref(String key) { | ||
return sharedPreferences.getString(key, null); | ||
} | ||
|
||
public boolean getBooleanInPef(String key) { | ||
return sharedPreferences.getBoolean(key, false); | ||
} | ||
|
||
public void deletePreference() { | ||
editor.clear(); | ||
editor.commit(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.customer; | ||
|
||
|
||
public class Constants { | ||
|
||
public static final String STEP_ONE = "step_one",STEP_TWO = "step_two",STEP_THREE="step_three", | ||
STEP_FOUR="step_four",STEP_FIVE="step_five",FIRST_TIME="first_time",TRACKING_ID = "tracking_id"; | ||
|
||
public static final int COARSE_LOCATION_PERMISSION = 4,SHOW_GPS_DIALOG = 2; | ||
|
||
public static final String STEP_ONE_RUNNING = "step_one_running",STEP_TWO_RUNNING = "step_two_running", | ||
STEP_THREE_RUNNING= "step_three_running",STEP_FOUR_RUNNING = "step_three_running"; | ||
} |