T2P upload data newss
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 23
|
compileSdkVersion 24
|
||||||
buildToolsVersion "24.0.1"
|
buildToolsVersion "24.0.1"
|
||||||
|
|
||||||
useLibrary 'org.apache.http.legacy'
|
useLibrary 'org.apache.http.legacy'
|
||||||
@@ -35,11 +35,11 @@ dependencies {
|
|||||||
|
|
||||||
compile 'com.android.support:appcompat-v7:24.2.1'
|
compile 'com.android.support:appcompat-v7:24.2.1'
|
||||||
compile 'com.android.support:design:24.2.1'
|
compile 'com.android.support:design:24.2.1'
|
||||||
compile 'com.google.android.gms:play-services-location:9.4.0'
|
compile 'com.google.android.gms:play-services-location:9.8.0'
|
||||||
compile 'com.google.android.gms:play-services-maps:9.4.0'
|
compile 'com.google.android.gms:play-services-maps:9.8.0'
|
||||||
compile 'com.android.support:cardview-v7:24.2.1'
|
compile 'com.android.support:cardview-v7:24.2.1'
|
||||||
compile 'com.google.android.gms:play-services-appindexing:9.4.0'
|
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
|
||||||
compile 'com.android.support:support-v4:24.2.1'
|
compile 'com.android.support:support-v4:24.2.1'
|
||||||
testCompile 'junit:junit:4.12'
|
|
||||||
compile 'com.google.code.gson:gson:2.7'
|
compile 'com.google.code.gson:gson:2.7'
|
||||||
|
testCompile 'junit:junit:4.12'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,6 +152,10 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.CheckoutActivity"
|
android:name=".dailyentry.CheckoutActivity"
|
||||||
android:label="@string/title_activity_checkout"
|
android:label="@string/title_activity_checkout"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.ServiceActivity"
|
||||||
|
android:label="@string/title_activity_service"
|
||||||
android:theme="@style/AppTheme.NoActionBar"></activity>
|
android:theme="@style/AppTheme.NoActionBar"></activity>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
|||||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.dailyentry.AdditionalVisibility;
|
import cpm.com.gskmtorange.dailyentry.AdditionalVisibility;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.ServiceActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.SettingsActivity;
|
import cpm.com.gskmtorange.dailyentry.SettingsActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.T2PComplianceActivity;
|
import cpm.com.gskmtorange.dailyentry.T2PComplianceActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.StoreListActivity;
|
import cpm.com.gskmtorange.dailyentry.StoreListActivity;
|
||||||
@@ -223,16 +224,6 @@ public class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
intent = new Intent(getBaseContext(),
|
|
||||||
UploadOptionActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
|
|
||||||
MainMenuActivity.this.finish();*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -260,88 +251,28 @@ public class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
} else if (id == R.id.nav_exit) {
|
} else if (id == R.id.nav_exit) {
|
||||||
|
|
||||||
|
|
||||||
/* Intent startDownload = new Intent(this,AdditionalVisibility.class);
|
|
||||||
startActivity(startDownload);
|
|
||||||
|
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
|
||||||
*/
|
|
||||||
finish();
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
} else if (id == R.id.nav_services) {
|
|
||||||
|
|
||||||
/*Intent startDownload = new Intent(this,T2PComplianceActivity.class);
|
|
||||||
startActivity(startDownload);
|
|
||||||
*/
|
|
||||||
//overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
|
||||||
|
|
||||||
} else if (id == R.id.nav_setting) {
|
} else if (id == R.id.nav_setting) {
|
||||||
|
|
||||||
Intent startDownload = new Intent(this, SettingsActivity.class);
|
Intent startDownload = new Intent(this, SettingsActivity.class);
|
||||||
startActivity(startDownload);
|
startActivity(startDownload);
|
||||||
|
|
||||||
|
finish();
|
||||||
|
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
|
||||||
//startActivity(new Intent(MainActivity.this, CategoryListActivity.class));
|
//startActivity(new Intent(MainActivity.this, CategoryListActivity.class));
|
||||||
|
|
||||||
} /*else if (id == R.id.nav_export) {
|
} else if (id == R.id.nav_services) {
|
||||||
|
|
||||||
AlertDialog.Builder builder1 = new AlertDialog.Builder(MainActivity.this);
|
Intent startservice = new Intent(this, ServiceActivity.class);
|
||||||
builder1.setMessage("Are you sure you want to take the backup of your data")
|
startActivity(startservice);
|
||||||
.setCancelable(false)
|
|
||||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
|
||||||
@SuppressWarnings("resource")
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
try {
|
|
||||||
*//*File file = new File(Environment
|
|
||||||
.getExternalStorageDirectory(),
|
|
||||||
"capital_backup");
|
|
||||||
if (!file.isDirectory()) {
|
|
||||||
file.mkdir();
|
|
||||||
}*//*
|
|
||||||
|
|
||||||
File sd = Environment.getExternalStorageDirectory();
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
File data = Environment.getDataDirectory();
|
|
||||||
|
|
||||||
if (sd.canWrite()) {
|
|
||||||
long date = System.currentTimeMillis();
|
|
||||||
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("MMM/dd/yy");
|
|
||||||
String dateString = sdf.format(date);
|
|
||||||
|
|
||||||
String currentDBPath = "//data//cpm.com.gskmtorange//databases//" + GSKOrangeDB.DATABASE_NAME;
|
|
||||||
String backupDBPath = "GSKMT_ORANGE_Database_backup" + dateString.replace('/', '-');
|
|
||||||
|
|
||||||
String path = Environment.getExternalStorageDirectory().getPath();
|
|
||||||
|
|
||||||
File currentDB = new File(data, currentDBPath);
|
|
||||||
File backupDB = new File(path, backupDBPath);
|
|
||||||
|
|
||||||
//Snackbar.make(rec_store_data, "Database Exported Successfully", Snackbar.LENGTH_SHORT).show();
|
|
||||||
Toast.makeText(MainActivity.this, "Database Exported Successfully", Toast.LENGTH_SHORT).show();
|
|
||||||
|
|
||||||
if (currentDB.exists()) {
|
|
||||||
@SuppressWarnings("resource")
|
|
||||||
FileChannel src = new FileInputStream(currentDB).getChannel();
|
|
||||||
FileChannel dst = new FileOutputStream(backupDB).getChannel();
|
|
||||||
dst.transferFrom(src, 0, src.size());
|
|
||||||
src.close();
|
|
||||||
dst.close();
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
System.out.println(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
dialog.cancel();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
AlertDialog alert1 = builder1.create();
|
|
||||||
alert1.show();
|
|
||||||
}*/
|
|
||||||
|
|
||||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||||
drawer.closeDrawer(GravityCompat.START);
|
drawer.closeDrawer(GravityCompat.START);
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class SelectLanguageActivity extends AppCompatActivity implements View.On
|
|||||||
intent.putExtra(CommonString.KEY_LOGIN_DATA, login_data);
|
intent.putExtra(CommonString.KEY_LOGIN_DATA, login_data);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
Snackbar.make(view, getString(R.string.select_language), Snackbar.LENGTH_LONG)
|
||||||
.setAction("Action", null).show();
|
.setAction("Action", null).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,111 @@
|
|||||||
|
package cpm.com.gskmtorange.dailyentry;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.support.design.widget.FloatingActionButton;
|
||||||
|
import android.support.design.widget.Snackbar;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.fragment.ServiceActivityFragment;
|
||||||
|
|
||||||
|
public class ServiceActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private SharedPreferences preferences;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_service);
|
||||||
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
|
//preference data
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
|
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
|
/* ServiceActivityFragment fragment = new ServiceActivityFragment();
|
||||||
|
getSupportFragmentManager().beginTransaction().add(R.id.fragment,fragment).commit();*/
|
||||||
|
|
||||||
|
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||||
|
.setAction("Action", null).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// Handle action bar item clicks here. The action bar will
|
||||||
|
// automatically handle clicks on the Home/Up button, so long
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
if (id == android.R.id.home) {
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
|
||||||
|
//noinspection SimplifiableIfStatement
|
||||||
|
if (id == R.id.action_settings) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
super.onBackPressed();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean updateResources(Context context, String language) {
|
||||||
|
String lang;
|
||||||
|
|
||||||
|
if(language.equalsIgnoreCase("English")){
|
||||||
|
lang = "EN";
|
||||||
|
}
|
||||||
|
else if(language.equalsIgnoreCase("UAE")) {
|
||||||
|
|
||||||
|
lang = "AR";
|
||||||
|
} else {
|
||||||
|
lang = "TR";
|
||||||
|
}
|
||||||
|
|
||||||
|
Locale locale = new Locale(lang);
|
||||||
|
Locale.setDefault(locale);
|
||||||
|
|
||||||
|
Resources resources = context.getResources();
|
||||||
|
|
||||||
|
Configuration configuration = resources.getConfiguration();
|
||||||
|
configuration.locale = locale;
|
||||||
|
|
||||||
|
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,20 +1,38 @@
|
|||||||
package cpm.com.gskmtorange.dailyentry;
|
package cpm.com.gskmtorange.dailyentry;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
import android.content.res.Resources;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.support.design.widget.FloatingActionButton;
|
import android.support.design.widget.FloatingActionButton;
|
||||||
import android.support.design.widget.Snackbar;
|
import android.support.design.widget.Snackbar;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.MainActivity;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.fragment.SelectLanguageFragment;
|
import cpm.com.gskmtorange.fragment.SelectLanguageFragment;
|
||||||
import cpm.com.gskmtorange.fragment.SettingsActivityFragment;
|
import cpm.com.gskmtorange.fragment.SettingsActivityFragment;
|
||||||
|
|
||||||
public class SettingsActivity extends AppCompatActivity implements SelectLanguageFragment.OnFragmentInteractionListener {
|
public class SettingsActivity extends AppCompatActivity implements SelectLanguageFragment.OnFragmentInteractionListener {
|
||||||
|
|
||||||
boolean isSelected = false;
|
String selected_lang = "", culture_id, notice_url;
|
||||||
|
|
||||||
|
FloatingActionButton fab;
|
||||||
|
|
||||||
|
private SharedPreferences preferences;
|
||||||
|
|
||||||
|
private SharedPreferences.Editor editor = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -23,20 +41,38 @@ public class SettingsActivity extends AppCompatActivity implements SelectLanguag
|
|||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
SettingsActivityFragment fragment = new SettingsActivityFragment();
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportFragmentManager().beginTransaction().add(R.id.fragment,fragment).commit();
|
|
||||||
|
|
||||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
//preference data
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
editor = preferences.edit();
|
||||||
|
|
||||||
|
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
|
/* SettingsActivityFragment fragment = new SettingsActivityFragment();
|
||||||
|
getSupportFragmentManager().beginTransaction().add(R.id.fragment,fragment).commit();*/
|
||||||
|
|
||||||
|
fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
fab.setOnClickListener(new View.OnClickListener() {
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
if(isSelected){
|
if (selected_lang.equals("")) {
|
||||||
finish();
|
|
||||||
}
|
Snackbar.make(view, getString(R.string.select_language), Snackbar.LENGTH_LONG)
|
||||||
else {
|
|
||||||
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
|
||||||
.setAction("Action", null).show();
|
.setAction("Action", null).show();
|
||||||
|
} else {
|
||||||
|
|
||||||
|
updateResources(getApplicationContext(),selected_lang);
|
||||||
|
|
||||||
|
editor.putString(CommonString.KEY_LANGUAGE, selected_lang);
|
||||||
|
editor.putString(CommonString.KEY_CULTURE_ID, culture_id);
|
||||||
|
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, notice_url);
|
||||||
|
editor.commit();
|
||||||
|
|
||||||
|
Intent startDownload = new Intent(getApplicationContext(), MainActivity.class);
|
||||||
|
startActivity(startDownload);
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -45,7 +81,81 @@ public class SettingsActivity extends AppCompatActivity implements SelectLanguag
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFragmentInteraction(boolean isSelected) {
|
public void onFragmentInteraction(String selected_lang, String culture_id, String notice_url) {
|
||||||
this.isSelected = isSelected;
|
|
||||||
|
this.selected_lang = selected_lang;
|
||||||
|
this.culture_id = culture_id;
|
||||||
|
this.notice_url = notice_url;
|
||||||
|
|
||||||
|
if (!selected_lang.equals("")) {
|
||||||
|
fab.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// Handle action bar item clicks here. The action bar will
|
||||||
|
// automatically handle clicks on the Home/Up button, so long
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
if (id == android.R.id.home) {
|
||||||
|
|
||||||
|
Intent startDownload = new Intent(getApplicationContext(), MainActivity.class);
|
||||||
|
startActivity(startDownload);
|
||||||
|
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
|
||||||
|
//noinspection SimplifiableIfStatement
|
||||||
|
if (id == R.id.action_settings) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
//super.onBackPressed();
|
||||||
|
Intent startDownload = new Intent(getApplicationContext(), MainActivity.class);
|
||||||
|
startActivity(startDownload);
|
||||||
|
|
||||||
|
finish();
|
||||||
|
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean updateResources(Context context, String language) {
|
||||||
|
String lang;
|
||||||
|
|
||||||
|
if(language.equalsIgnoreCase("English")){
|
||||||
|
lang = "EN";
|
||||||
|
}
|
||||||
|
else if(language.equalsIgnoreCase("UAE")) {
|
||||||
|
|
||||||
|
lang = "AR";
|
||||||
|
} else {
|
||||||
|
lang = "TR";
|
||||||
|
}
|
||||||
|
|
||||||
|
Locale locale = new Locale(lang);
|
||||||
|
Locale.setDefault(locale);
|
||||||
|
|
||||||
|
Resources resources = context.getResources();
|
||||||
|
|
||||||
|
Configuration configuration = resources.getConfiguration();
|
||||||
|
configuration.locale = locale;
|
||||||
|
|
||||||
|
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,6 +135,12 @@ public class StoreListActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
super.onBackPressed();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
// Handle action bar item clicks here. The action bar will
|
// Handle action bar item clicks here. The action bar will
|
||||||
|
|||||||
@@ -516,7 +516,24 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
||||||
if (id == android.R.id.home) {
|
if (id == android.R.id.home) {
|
||||||
|
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(T2PComplianceActivity.this);
|
||||||
|
builder.setTitle("Parinaam");
|
||||||
|
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||||
|
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton("Cancel ", new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
android.app.AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
//noinspection SimplifiableIfStatement
|
//noinspection SimplifiableIfStatement
|
||||||
@@ -647,6 +664,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton("Cancel ", new DialogInterface.OnClickListener() {
|
.setNegativeButton("Cancel ", new DialogInterface.OnClickListener() {
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
return "BRAND_MASTER";
|
return "BRAND_MASTER";
|
||||||
}
|
}
|
||||||
|
|
||||||
data.value = 30;
|
data.value = 25;
|
||||||
data.name = "BRAND_MASTER "+getResources().getString(R.string.download_data);
|
data.name = "BRAND_MASTER "+getResources().getString(R.string.download_data);
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
@@ -281,7 +281,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
return "SUB_CATEGORY_MASTER";
|
return "SUB_CATEGORY_MASTER";
|
||||||
}
|
}
|
||||||
data.value = 40;
|
data.value = 30;
|
||||||
data.name = "SUB_CATEGORY_MASTER "+getResources().getString(R.string.download_data);
|
data.name = "SUB_CATEGORY_MASTER "+getResources().getString(R.string.download_data);
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
@@ -316,7 +316,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
return "CATEGORY_MASTER";
|
return "CATEGORY_MASTER";
|
||||||
}
|
}
|
||||||
data.value = 50;
|
data.value = 35;
|
||||||
data.name = "CATEGORY_MASTER "+getResources().getString(R.string.download_data);
|
data.name = "CATEGORY_MASTER "+getResources().getString(R.string.download_data);
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
@@ -351,7 +351,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
return "DISPLAY_MASTER";
|
return "DISPLAY_MASTER";
|
||||||
}
|
}
|
||||||
data.value = 60;
|
data.value = 40;
|
||||||
data.name = "DISPLAY_MASTER "+getResources().getString(R.string.download_data);
|
data.name = "DISPLAY_MASTER "+getResources().getString(R.string.download_data);
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
@@ -386,7 +386,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
return "MAPPING_STOCK";
|
return "MAPPING_STOCK";
|
||||||
}
|
}
|
||||||
data.value = 80;
|
data.value = 45;
|
||||||
data.name = "MAPPING_STOCK "+getResources().getString(R.string.download_data);
|
data.name = "MAPPING_STOCK "+getResources().getString(R.string.download_data);
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
@@ -421,7 +421,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
//return "MAPPING_T2P";
|
//return "MAPPING_T2P";
|
||||||
}
|
}
|
||||||
data.value = 100;
|
data.value = 50;
|
||||||
data.name = "MAPPING_T2P "+getResources().getString(R.string.download_data);
|
data.name = "MAPPING_T2P "+getResources().getString(R.string.download_data);
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
@@ -455,7 +455,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
return "DISPLAY_CHECKLIST_MASTER";
|
return "DISPLAY_CHECKLIST_MASTER";
|
||||||
}
|
}
|
||||||
data.value = 100;
|
data.value = 55;
|
||||||
data.name = "DISPLAY_CHECKLIST_MASTER "+getResources().getString(R.string.download_data);
|
data.name = "DISPLAY_CHECKLIST_MASTER "+getResources().getString(R.string.download_data);
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
@@ -489,7 +489,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
//return "MAPPING_DISPLAY_CHECKLIST";
|
//return "MAPPING_DISPLAY_CHECKLIST";
|
||||||
}
|
}
|
||||||
data.value = 100;
|
data.value = 60;
|
||||||
data.name = "MAPPING_DISPLAY_CHECKLIST "+getResources().getString(R.string.download_data);
|
data.name = "MAPPING_DISPLAY_CHECKLIST "+getResources().getString(R.string.download_data);
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
@@ -524,7 +524,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
return "NON_WORKING_REASON";
|
return "NON_WORKING_REASON";
|
||||||
}
|
}
|
||||||
data.value = 100;
|
data.value = 65;
|
||||||
data.name = "NON_WORKING_REASON "+getResources().getString(R.string.download_data);
|
data.name = "NON_WORKING_REASON "+getResources().getString(R.string.download_data);
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
@@ -559,7 +559,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
/*} else {
|
/*} else {
|
||||||
//return "MAPPING_PROMOTION";
|
//return "MAPPING_PROMOTION";
|
||||||
}*/
|
}*/
|
||||||
data.value = 100;
|
data.value = 70;
|
||||||
data.name = "MAPPING_PROMOTION "+getResources().getString(R.string.download_data);
|
data.name = "MAPPING_PROMOTION "+getResources().getString(R.string.download_data);
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
@@ -597,7 +597,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
/*} else {
|
/*} else {
|
||||||
//return "MAPPING_ADDITIONAL_PROMOTION";
|
//return "MAPPING_ADDITIONAL_PROMOTION";
|
||||||
}*/
|
}*/
|
||||||
data.value = 100;
|
data.value = 75;
|
||||||
data.name = "MAPPING_ADDITIONAL_PROMOTION "+getResources().getString(R.string.download_data);
|
data.name = "MAPPING_ADDITIONAL_PROMOTION "+getResources().getString(R.string.download_data);
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
@@ -633,7 +633,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
//return "STORE_PERFORMANCE";
|
//return "STORE_PERFORMANCE";
|
||||||
}
|
}
|
||||||
data.value = 100;
|
data.value = 80;
|
||||||
data.name = "STORE_PERFORMANCE Data Download";
|
data.name = "STORE_PERFORMANCE Data Download";
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
@@ -669,7 +669,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
//return "MAPPING_PLANOGRAM";
|
//return "MAPPING_PLANOGRAM";
|
||||||
}
|
}
|
||||||
data.value = 100;
|
data.value = 85;
|
||||||
data.name = "MAPPING_PLANOGRAM Data Download";
|
data.name = "MAPPING_PLANOGRAM Data Download";
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
@@ -797,7 +797,9 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
super.onPostExecute(s);
|
super.onPostExecute(s);
|
||||||
|
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
finish();
|
|
||||||
|
showAlert(getString(R.string.data_downloaded_successfully));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -813,6 +815,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
/* Intent i = new Intent(activity, StorelistActivity.class);
|
/* Intent i = new Intent(activity, StorelistActivity.class);
|
||||||
activity.startActivity(i);
|
activity.startActivity(i);
|
||||||
activity.finish();*/
|
activity.finish();*/
|
||||||
|
finish();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -111,6 +111,17 @@ public class SelectLanguageFragment extends Fragment implements View.OnClickList
|
|||||||
btn_lang_1.setText(language.get(0));
|
btn_lang_1.setText(language.get(0));
|
||||||
btn_lang_2.setText(language.get(1));
|
btn_lang_2.setText(language.get(1));
|
||||||
|
|
||||||
|
String lang = preferences.getString(CommonString.KEY_LANGUAGE, "");
|
||||||
|
|
||||||
|
if(lang.equals(language.get(0))){
|
||||||
|
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||||
|
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
|
}
|
||||||
|
else if(lang.equals(language.get(1))){
|
||||||
|
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
|
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||||
|
}
|
||||||
|
|
||||||
btn_lang_1.setOnClickListener(this);
|
btn_lang_1.setOnClickListener(this);
|
||||||
btn_lang_2.setOnClickListener(this);
|
btn_lang_2.setOnClickListener(this);
|
||||||
}
|
}
|
||||||
@@ -118,10 +129,10 @@ public class SelectLanguageFragment extends Fragment implements View.OnClickList
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Rename method, update argument and hook method into UI event
|
// TODO: Rename method, update argument and hook method into UI event
|
||||||
public void onButtonPressed(boolean selected_flag) {
|
public void onButtonPressed(String selected_lang, String culture_id, String notice_url) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
|
|
||||||
mListener.onFragmentInteraction(selected_flag);
|
mListener.onFragmentInteraction(selected_lang,culture_id,notice_url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,7 +161,7 @@ public class SelectLanguageFragment extends Fragment implements View.OnClickList
|
|||||||
case R.id.btn_language_one:
|
case R.id.btn_language_one:
|
||||||
|
|
||||||
//selected_flag = true;
|
//selected_flag = true;
|
||||||
onButtonPressed(true);
|
onButtonPressed(language.get(0),culture_id.get(0),login_data.getNOTICE_URL().get(0));
|
||||||
|
|
||||||
updateResources(getActivity(), language.get(0));
|
updateResources(getActivity(), language.get(0));
|
||||||
|
|
||||||
@@ -168,7 +179,7 @@ public class SelectLanguageFragment extends Fragment implements View.OnClickList
|
|||||||
|
|
||||||
//selected_flag = true;
|
//selected_flag = true;
|
||||||
|
|
||||||
onButtonPressed(true);
|
onButtonPressed(language.get(1),culture_id.get(1),login_data.getNOTICE_URL().get(1));
|
||||||
|
|
||||||
updateResources(getActivity(), language.get(1));
|
updateResources(getActivity(), language.get(1));
|
||||||
|
|
||||||
@@ -196,7 +207,7 @@ public class SelectLanguageFragment extends Fragment implements View.OnClickList
|
|||||||
*/
|
*/
|
||||||
public interface OnFragmentInteractionListener {
|
public interface OnFragmentInteractionListener {
|
||||||
// TODO: Update argument type and name
|
// TODO: Update argument type and name
|
||||||
void onFragmentInteraction(boolean flag);
|
void onFragmentInteraction(String lang, String culture_id, String notice);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getDataFromSharedPreferences(){
|
private void getDataFromSharedPreferences(){
|
||||||
|
|||||||
@@ -0,0 +1,203 @@
|
|||||||
|
package cpm.com.gskmtorange.fragment;
|
||||||
|
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.os.Environment;
|
||||||
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.support.v7.widget.CardView;
|
||||||
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.nio.channels.FileChannel;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.ServiceActivity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A placeholder fragment containing a simple view.
|
||||||
|
*/
|
||||||
|
public class ServiceActivityFragment extends Fragment {
|
||||||
|
|
||||||
|
public ServiceActivityFragment() {
|
||||||
|
}
|
||||||
|
|
||||||
|
ArrayList<ServiceGetterSetter> serviceList;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
View view = inflater.inflate(R.layout.fragment_service, container, false);
|
||||||
|
|
||||||
|
RecyclerView rec = (RecyclerView) view.findViewById(R.id.rec_settings);
|
||||||
|
|
||||||
|
ServiceGetterSetter service = new ServiceGetterSetter();
|
||||||
|
service.setName(getString(R.string.export_database));
|
||||||
|
service.setIcon(R.mipmap.entry_grey);
|
||||||
|
//SelectLanguageFragment selectLanguageFragment = new SelectLanguageFragment();
|
||||||
|
service.setFragment(null);
|
||||||
|
|
||||||
|
serviceList = new ArrayList<>();
|
||||||
|
serviceList.add(service);
|
||||||
|
|
||||||
|
rec.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
|
ServiceAdapter serviceAdapter = new ServiceAdapter();
|
||||||
|
rec.setAdapter(serviceAdapter);
|
||||||
|
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
class ServiceAdapter extends RecyclerView.Adapter<ServiceAdapter.ViewHolder>{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
View view = LayoutInflater.from(parent.getContext())
|
||||||
|
.inflate(R.layout.settings_item_layout, parent, false);
|
||||||
|
return new ViewHolder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(ViewHolder holder, int position) {
|
||||||
|
final ServiceGetterSetter mItem = serviceList.get(position);
|
||||||
|
holder.tv_settings.setText(mItem.getName());
|
||||||
|
|
||||||
|
holder.cardView.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Fragment nextFrag= mItem.getFragment();
|
||||||
|
|
||||||
|
if(nextFrag != null){
|
||||||
|
getActivity().getSupportFragmentManager().beginTransaction()
|
||||||
|
.replace(R.id.fragment, nextFrag,"Settings")
|
||||||
|
.addToBackStack(null)
|
||||||
|
.commit();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
showExportDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return serviceList.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
class ViewHolder extends RecyclerView.ViewHolder{
|
||||||
|
|
||||||
|
public CardView cardView;
|
||||||
|
public TextView tv_settings;
|
||||||
|
|
||||||
|
public ViewHolder(View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
cardView = (CardView) itemView.findViewById(R.id.card_layout);
|
||||||
|
tv_settings = (TextView) itemView.findViewById(R.id.tv_settings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ServiceGetterSetter{
|
||||||
|
|
||||||
|
String name;
|
||||||
|
int icon;
|
||||||
|
Fragment fragment;
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIcon() {
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIcon(int icon) {
|
||||||
|
this.icon = icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Fragment getFragment() {
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFragment(Fragment fragment) {
|
||||||
|
this.fragment = fragment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showExportDialog(){
|
||||||
|
|
||||||
|
AlertDialog.Builder builder1 = new AlertDialog.Builder(getActivity());
|
||||||
|
builder1.setMessage("Are you sure you want to take the backup of your data")
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||||
|
@SuppressWarnings("resource")
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
try {
|
||||||
|
File file = new File(Environment
|
||||||
|
.getExternalStorageDirectory(),
|
||||||
|
"gsk_orange_backup");
|
||||||
|
if (!file.isDirectory()) {
|
||||||
|
file.mkdir();
|
||||||
|
}
|
||||||
|
|
||||||
|
File sd = Environment.getExternalStorageDirectory();
|
||||||
|
File data = Environment.getDataDirectory();
|
||||||
|
|
||||||
|
if (sd.canWrite()) {
|
||||||
|
long date = System.currentTimeMillis();
|
||||||
|
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("MMM/dd/yy");
|
||||||
|
String dateString = sdf.format(date);
|
||||||
|
|
||||||
|
String currentDBPath = "//data//cpm.com.gskmtorange//databases//" + GSKOrangeDB.DATABASE_NAME;
|
||||||
|
String backupDBPath = "GSKMT_ORANGE_Database_backup" + dateString.replace('/', '-');
|
||||||
|
|
||||||
|
String path = Environment.getExternalStorageDirectory().getPath()+ "/gsk_orange_backup";
|
||||||
|
|
||||||
|
File currentDB = new File(data, currentDBPath);
|
||||||
|
File backupDB = new File(path, backupDBPath);
|
||||||
|
|
||||||
|
//Snackbar.make(rec_store_data, "Database Exported Successfully", Snackbar.LENGTH_SHORT).show();
|
||||||
|
Toast.makeText(getActivity(), getString(R.string.data_exported_successfully), Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
|
if (currentDB.exists()) {
|
||||||
|
@SuppressWarnings("resource")
|
||||||
|
FileChannel src = new FileInputStream(currentDB).getChannel();
|
||||||
|
FileChannel dst = new FileOutputStream(backupDB).getChannel();
|
||||||
|
dst.transferFrom(src, 0, src.size());
|
||||||
|
src.close();
|
||||||
|
dst.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
dialog.cancel();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert1 = builder1.create();
|
||||||
|
alert1.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -79,7 +79,7 @@ public class SettingsActivityFragment extends Fragment {
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Fragment nextFrag= mItem.getFragment();
|
Fragment nextFrag= mItem.getFragment();
|
||||||
getActivity().getSupportFragmentManager().beginTransaction()
|
getActivity().getSupportFragmentManager().beginTransaction()
|
||||||
.replace(R.id.fragment, nextFrag,"Settings")
|
.add(R.id.fragment, nextFrag,"Settings")
|
||||||
.addToBackStack(null)
|
.addToBackStack(null)
|
||||||
.commit();
|
.commit();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
tools:context="cpm.com.gskmtorange.dailyentry.ServiceActivity">
|
||||||
|
|
||||||
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:theme="@style/AppTheme.AppBarOverlay">
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="?attr/colorPrimary"
|
||||||
|
app:popupTheme="@style/AppTheme.PopupOverlay" />
|
||||||
|
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<include layout="@layout/content_service" />
|
||||||
|
|
||||||
|
<android.support.design.widget.FloatingActionButton
|
||||||
|
android:id="@+id/fab"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:layout_margin="@dimen/fab_margin"
|
||||||
|
app:srcCompat="@android:drawable/ic_dialog_email" />
|
||||||
|
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
@@ -25,10 +25,11 @@
|
|||||||
|
|
||||||
<android.support.design.widget.FloatingActionButton
|
<android.support.design.widget.FloatingActionButton
|
||||||
android:id="@+id/fab"
|
android:id="@+id/fab"
|
||||||
|
android:visibility="gone"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom|end"
|
android:layout_gravity="bottom|end"
|
||||||
android:layout_margin="@dimen/fab_margin"
|
android:layout_margin="@dimen/fab_margin"
|
||||||
app:srcCompat="@android:drawable/ic_dialog_email" />
|
app:srcCompat="@mipmap/tick" />
|
||||||
|
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/fragment"
|
||||||
|
android:name="cpm.com.gskmtorange.fragment.ServiceActivityFragment"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
|
tools:layout="@layout/fragment_service" />
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
android:paddingTop="@dimen/activity_vertical_margin"
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
|
android:background="@color/grey_background"
|
||||||
>
|
>
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
<android.support.v7.widget.CardView
|
||||||
@@ -26,7 +27,8 @@
|
|||||||
android:layout_marginRight="5dp"
|
android:layout_marginRight="5dp"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
card_view:cardBackgroundColor="@color/white"
|
card_view:cardBackgroundColor="@color/white"
|
||||||
card_view:cardCornerRadius="5dp">
|
card_view:cardCornerRadius="5dp"
|
||||||
|
app:cardElevation="2dp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ans_layout"
|
android:id="@+id/ans_layout"
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/content_service"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingBottom="@dimen/custom_margin"
|
||||||
|
android:paddingLeft="@dimen/custom_margin"
|
||||||
|
android:paddingRight="@dimen/custom_margin"
|
||||||
|
android:paddingTop="@dimen/custom_margin"
|
||||||
|
tools:context="cpm.com.gskmtorange.fragment.ServiceActivityFragment"
|
||||||
|
tools:showIn="@layout/activity_service">
|
||||||
|
|
||||||
|
<android.support.v7.widget.RecyclerView
|
||||||
|
android:id="@+id/rec_settings"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
>
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
android:id="@+id/card_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/custom_margin"
|
||||||
|
android:layout_marginRight="@dimen/custom_margin"
|
||||||
|
android:layout_marginTop="@dimen/custom_margin"
|
||||||
|
card_view:cardBackgroundColor="@color/white"
|
||||||
|
card_view:cardCornerRadius="10dp"
|
||||||
|
>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/parent_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_weight="3"
|
||||||
|
>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:padding="5dp"
|
||||||
|
>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/btn_is_present"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textOn="@string/yes"
|
||||||
|
android:textOff="@string/no"
|
||||||
|
android:background="@mipmap/exit_grey"
|
||||||
|
android:layout_centerInParent="true"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_settings"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="2"
|
||||||
|
android:text="Checklist"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingLeft="@dimen/custom_margin"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
tools:context="cpm.com.gskmtorange.dailyentry.ServiceActivity">
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_settings"
|
||||||
|
android:orderInCategory="100"
|
||||||
|
android:title="@string/action_settings"
|
||||||
|
app:showAsAction="never" />
|
||||||
|
</menu>
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||||
<dimen name="fab_margin">16dp</dimen>
|
<dimen name="fab_margin">16dp</dimen>
|
||||||
|
|
||||||
<dimen name="custom_margin">10dp</dimen>
|
<dimen name="custom_margin">5dp</dimen>
|
||||||
|
|
||||||
<dimen name="text_size_normal">20sp</dimen>
|
<dimen name="text_size_normal">20sp</dimen>
|
||||||
<dimen name="text_size_small">16sp</dimen>
|
<dimen name="text_size_small">16sp</dimen>
|
||||||
|
|||||||
@@ -196,7 +196,7 @@
|
|||||||
|
|
||||||
<!--Gagan start new code 2-->
|
<!--Gagan start new code 2-->
|
||||||
<string name="stock_facing_planogram_dialog_title">Planogram</string>
|
<string name="stock_facing_planogram_dialog_title">Planogram</string>
|
||||||
<string name="title_activity_settings">SettingsActivity</string>
|
<string name="title_activity_settings">Settings</string>
|
||||||
|
|
||||||
<string name="ok">OK</string>
|
<string name="ok">OK</string>
|
||||||
<string name="check_save_message">Are you sure you want to save</string>
|
<string name="check_save_message">Are you sure you want to save</string>
|
||||||
@@ -214,5 +214,12 @@
|
|||||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||||
<string name="title_activity_checkout">CheckoutActivity</string>
|
<string name="title_activity_checkout">CheckoutActivity</string>
|
||||||
<string name="checkout_successful">Checkout Success</string>
|
<string name="checkout_successful">Checkout Success</string>
|
||||||
|
<string name="title_activity_service">Service</string>
|
||||||
|
|
||||||
|
<string name="data_downloaded_successfully">Data downloaded successfully</string>
|
||||||
|
<string name="export_database">Export Database</string>
|
||||||
|
<string name="data_exported_successfully">Database Exported Successfully</string>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user