T2P upload data newss
This commit is contained in:
Generated
+1
-1
@@ -41,7 +41,7 @@
|
||||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 23
|
||||
compileSdkVersion 24
|
||||
buildToolsVersion "24.0.1"
|
||||
|
||||
useLibrary 'org.apache.http.legacy'
|
||||
@@ -32,12 +32,14 @@ dependencies {
|
||||
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
})
|
||||
|
||||
compile 'com.android.support:appcompat-v7:24.2.1'
|
||||
compile 'com.android.support:design:24.2.1'
|
||||
testCompile 'junit:junit:4.12'
|
||||
|
||||
compile 'com.google.android.gms:play-services-location:9.0.2'
|
||||
compile 'com.google.android.gms:play-services-maps:9.0.2'
|
||||
compile 'com.google.android.gms:play-services-location:9.4.0'
|
||||
compile 'com.google.android.gms:play-services-maps:9.4.0'
|
||||
compile 'com.android.support:cardview-v7:24.2.1'
|
||||
compile 'com.google.android.gms:play-services-appindexing:9.0.2'
|
||||
compile 'com.google.android.gms:play-services-appindexing:9.4.0'
|
||||
compile 'com.android.support:support-v4:24.2.1'
|
||||
testCompile 'junit:junit:4.12'
|
||||
compile 'com.google.code.gson:gson:2.7'
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
android:label="@string/title_activity_store_geotag"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
|
||||
<meta-data
|
||||
android:name="com.google.android.maps.v2.API_KEY"
|
||||
android:value="AIzaSyD02po19go2JMhXJeAnKDiZSiNloPsWqzI" />
|
||||
@@ -119,7 +120,6 @@
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
|
||||
<activity
|
||||
android:name=".gsk_dailyentry.StoreWisePerformanceActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
@@ -133,22 +133,22 @@
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_Non_Work"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar"/>
|
||||
|
||||
<activity
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".dailyentry.AdditionalVisibility"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_Additional_visibility"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar"/>
|
||||
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".upload.UploadActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_upload"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".dailyentry.SettingsActivity"
|
||||
android:label="@string/title_activity_settings"
|
||||
android:theme="@style/AppTheme.NoActionBar"></activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -838,7 +838,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
|
||||
cd.setCategory_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("CATEGORY_ID")));
|
||||
cd.setCategory(dbcursor.getString(dbcursor.getColumnIndexOrThrow("CATEGORY")));
|
||||
cd.setCategory_img("category");
|
||||
cd.setCategory_img(-1);
|
||||
|
||||
list.add(cd);
|
||||
dbcursor.moveToNext();
|
||||
@@ -2685,4 +2685,39 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
}
|
||||
//Gagan end new code 2
|
||||
|
||||
//T2P is filled
|
||||
public boolean isFilledT2P(String store_id, String category_id) {
|
||||
Log.d("T2P ", "T2P data--------------->Start<------------");
|
||||
ArrayList<T2PGetterSetter> list = new ArrayList<>();
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
dbcursor = db.rawQuery("SELECT * FROM " + CommonString.TABLE_INSERT_T2P_COMPLIANCE + " where " +
|
||||
CommonString.KEY_STORE_ID + "='" + store_id + "' AND " +
|
||||
CommonString.KEY_CATEGORY_ID + "='" + category_id + "'", null);
|
||||
|
||||
if (dbcursor != null) {
|
||||
if (dbcursor.moveToFirst()) {
|
||||
do {
|
||||
T2PGetterSetter tp = new T2PGetterSetter();
|
||||
|
||||
tp.setBrand_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_BRAND_ID)));
|
||||
list.add(tp);
|
||||
} while (dbcursor.moveToNext());
|
||||
}
|
||||
dbcursor.close();
|
||||
|
||||
if (list.size() > 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.d("Exception ", "when fetching Records!!!!" + e.toString());
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
|
||||
import org.ksoap2.SoapEnvelope;
|
||||
import org.ksoap2.serialization.SoapObject;
|
||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||
@@ -695,5 +694,7 @@ public class LoginActivity extends AppCompatActivity {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.dailyentry.AdditionalVisibility;
|
||||
import cpm.com.gskmtorange.dailyentry.SettingsActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.T2PComplianceActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.StoreListActivity;
|
||||
import cpm.com.gskmtorange.download.DownloadActivity;
|
||||
@@ -280,6 +281,11 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
} else if (id == R.id.nav_setting) {
|
||||
|
||||
Intent startDownload = new Intent(this,SettingsActivity.class);
|
||||
startActivity(startDownload);
|
||||
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
|
||||
//startActivity(new Intent(MainActivity.this, CategoryListActivity.class));
|
||||
|
||||
} /*else if (id == R.id.nav_export) {
|
||||
|
||||
@@ -15,6 +15,8 @@ import android.support.v7.widget.Toolbar;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -51,6 +53,8 @@ public class SelectLanguageActivity extends AppCompatActivity implements View.On
|
||||
language = login_data.getCULTURE_NAME();
|
||||
culture_id = login_data.getCULTURE_ID();
|
||||
|
||||
setDataFromSharedPreferences(login_data);
|
||||
|
||||
if (language.size() > 1) {
|
||||
|
||||
btn_lang_1.setText(language.get(0));
|
||||
@@ -144,4 +148,15 @@ public class SelectLanguageActivity extends AppCompatActivity implements View.On
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void setDataFromSharedPreferences(LoginGetterSetter lgs) {
|
||||
Gson gson = new Gson();
|
||||
String jsonCurProduct = gson.toJson(lgs);
|
||||
|
||||
//SharedPreferences sharedPref = getApplicationContext().getSharedPreferences(CommonString.KEY_LOOGIN_PREF, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
|
||||
editor.putString(CommonString.KEY_LOOGIN_PREF, jsonCurProduct);
|
||||
editor.commit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,9 +50,11 @@ public class CommonString {
|
||||
public static final String KEY_COVERAGE_REMARK = "REMARK";
|
||||
public static final String KEY_IMAGE = "IMAGE";
|
||||
public static final String KEY_IMAGE_URL = "IMAGE_URL";
|
||||
public static final String KEY_ID = "Id";
|
||||
public static final String KEY_ID = "Id";
|
||||
public static final String KEY_MERCHANDISER_ID = "MERCHANDISER_ID";
|
||||
|
||||
public static final String KEY_LOOGIN_PREF ="LOGIN_PREF";
|
||||
|
||||
//KEYS RELATED TO T2P COMPLIANCE
|
||||
|
||||
public static final String KEY_DISPLAY = "DISPLAY";
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package cpm.com.gskmtorange.dailyentry;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
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.View;
|
||||
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.fragment.SelectLanguageFragment;
|
||||
import cpm.com.gskmtorange.fragment.SettingsActivityFragment;
|
||||
|
||||
public class SettingsActivity extends AppCompatActivity implements SelectLanguageFragment.OnFragmentInteractionListener {
|
||||
|
||||
boolean isSelected = false;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_settings);
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
SettingsActivityFragment fragment = new SettingsActivityFragment();
|
||||
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) {
|
||||
|
||||
if(isSelected){
|
||||
finish();
|
||||
}
|
||||
else {
|
||||
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFragmentInteraction(boolean isSelected) {
|
||||
this.isSelected = isSelected;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,242 @@
|
||||
package cpm.com.gskmtorange.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
|
||||
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
* Activities that contain this fragment must implement the
|
||||
* {@link SelectLanguageFragment.OnFragmentInteractionListener} interface
|
||||
* to handle interaction events.
|
||||
* Use the {@link SelectLanguageFragment#newInstance} factory method to
|
||||
* create an instance of this fragment.
|
||||
*/
|
||||
public class SelectLanguageFragment extends Fragment implements View.OnClickListener{
|
||||
// TODO: Rename parameter arguments, choose names that match
|
||||
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
||||
private static final String ARG_PARAM1 = "param1";
|
||||
private static final String ARG_PARAM2 = "param2";
|
||||
|
||||
// TODO: Rename and change types of parameters
|
||||
private String mParam1;
|
||||
private String mParam2;
|
||||
|
||||
private OnFragmentInteractionListener mListener;
|
||||
|
||||
private SharedPreferences preferences = null;
|
||||
private SharedPreferences.Editor editor = null;
|
||||
|
||||
Button btn_lang_1, btn_lang_2;
|
||||
|
||||
ArrayList<String> language, culture_id;
|
||||
|
||||
LoginGetterSetter login_data;
|
||||
|
||||
public SelectLanguageFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this factory method to create a new instance of
|
||||
* this fragment using the provided parameters.
|
||||
*
|
||||
* @param param1 Parameter 1.
|
||||
* @param param2 Parameter 2.
|
||||
* @return A new instance of fragment SelectLanguageFragment.
|
||||
*/
|
||||
// TODO: Rename and change types and number of parameters
|
||||
public static SelectLanguageFragment newInstance(String param1, String param2) {
|
||||
SelectLanguageFragment fragment = new SelectLanguageFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putString(ARG_PARAM1, param1);
|
||||
args.putString(ARG_PARAM2, param2);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (getArguments() != null) {
|
||||
mParam1 = getArguments().getString(ARG_PARAM1);
|
||||
mParam2 = getArguments().getString(ARG_PARAM2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
View view = inflater.inflate(R.layout.fragment_select_language, container, false);
|
||||
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
||||
editor = preferences.edit();
|
||||
|
||||
getDataFromSharedPreferences();
|
||||
|
||||
btn_lang_1 = (Button) view.findViewById(R.id.btn_language_one);
|
||||
btn_lang_2 = (Button) view.findViewById(R.id.btn_language_two);
|
||||
|
||||
|
||||
/* login_data = (LoginGetterSetter) getIntent().getSerializableExtra(CommonString.KEY_LOGIN_DATA);
|
||||
language = login_data.getCULTURE_NAME();
|
||||
culture_id = login_data.getCULTURE_ID();
|
||||
*/
|
||||
if (language.size() > 1) {
|
||||
|
||||
btn_lang_1.setText(language.get(0));
|
||||
btn_lang_2.setText(language.get(1));
|
||||
|
||||
btn_lang_1.setOnClickListener(this);
|
||||
btn_lang_2.setOnClickListener(this);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
// TODO: Rename method, update argument and hook method into UI event
|
||||
public void onButtonPressed(boolean selected_flag) {
|
||||
if (mListener != null) {
|
||||
|
||||
mListener.onFragmentInteraction(selected_flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
if (context instanceof OnFragmentInteractionListener) {
|
||||
mListener = (OnFragmentInteractionListener) context;
|
||||
} else {
|
||||
throw new RuntimeException(context.toString()
|
||||
+ " must implement OnFragmentInteractionListener");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
mListener = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
|
||||
switch (id) {
|
||||
case R.id.btn_language_one:
|
||||
|
||||
//selected_flag = true;
|
||||
onButtonPressed(true);
|
||||
|
||||
updateResources(getActivity(), language.get(0));
|
||||
|
||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
|
||||
editor.putString(CommonString.KEY_LANGUAGE, language.get(0));
|
||||
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(0));
|
||||
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(0));
|
||||
editor.commit();
|
||||
|
||||
break;
|
||||
|
||||
case R.id.btn_language_two:
|
||||
|
||||
//selected_flag = true;
|
||||
|
||||
onButtonPressed(true);
|
||||
|
||||
updateResources(getActivity(), language.get(1));
|
||||
|
||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
|
||||
editor.putString(CommonString.KEY_LANGUAGE, language.get(1));
|
||||
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(1));
|
||||
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(1));
|
||||
editor.commit();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface must be implemented by activities that contain this
|
||||
* fragment to allow an interaction in this fragment to be communicated
|
||||
* to the activity and potentially other fragments contained in that
|
||||
* activity.
|
||||
* <p>
|
||||
* See the Android Training lesson <a href=
|
||||
* "http://developer.android.com/training/basics/fragments/communicating.html"
|
||||
* >Communicating with Other Fragments</a> for more information.
|
||||
*/
|
||||
public interface OnFragmentInteractionListener {
|
||||
// TODO: Update argument type and name
|
||||
void onFragmentInteraction(boolean flag);
|
||||
}
|
||||
|
||||
private void getDataFromSharedPreferences(){
|
||||
Gson gson = new Gson();
|
||||
login_data = new LoginGetterSetter();
|
||||
|
||||
String jsonPreferences = preferences.getString(CommonString.KEY_LOOGIN_PREF, "");
|
||||
|
||||
Type type = new TypeToken<LoginGetterSetter>() {}.getType();
|
||||
login_data = gson.fromJson(jsonPreferences, type);
|
||||
|
||||
language = login_data.getCULTURE_NAME();
|
||||
culture_id = login_data.getCULTURE_ID();
|
||||
|
||||
//return ;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
package cpm.com.gskmtorange.fragment;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v4.app.Fragment;
|
||||
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 com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
||||
|
||||
/**
|
||||
* A placeholder fragment containing a simple view.
|
||||
*/
|
||||
public class SettingsActivityFragment extends Fragment {
|
||||
|
||||
ArrayList<SettingsGetterSetter> settingsList;
|
||||
|
||||
public SettingsActivityFragment() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_settings, container, false);
|
||||
|
||||
RecyclerView rec = (RecyclerView) view.findViewById(R.id.rec_settings);
|
||||
|
||||
SettingsGetterSetter settings = new SettingsGetterSetter();
|
||||
settings.setName(getString(R.string.select_language_item));
|
||||
settings.setIcon(R.mipmap.entry_grey);
|
||||
SelectLanguageFragment selectLanguageFragment = new SelectLanguageFragment();
|
||||
settings.setFragment(selectLanguageFragment);
|
||||
|
||||
settingsList = new ArrayList<>();
|
||||
settingsList.add(settings);
|
||||
|
||||
rec.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
SettingsAdapter settingsAdapter = new SettingsAdapter();
|
||||
rec.setAdapter(settingsAdapter);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
class SettingsAdapter extends RecyclerView.Adapter<SettingsAdapter.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 SettingsGetterSetter mItem = settingsList.get(position);
|
||||
holder.tv_settings.setText(mItem.getName());
|
||||
|
||||
holder.cardView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Fragment nextFrag= mItem.getFragment();
|
||||
getActivity().getSupportFragmentManager().beginTransaction()
|
||||
.replace(R.id.fragment, nextFrag,"Settings")
|
||||
.addToBackStack(null)
|
||||
.commit();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return settingsList.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 SettingsGetterSetter{
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+9
-2
@@ -123,11 +123,18 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
categoryList.add(data);
|
||||
|
||||
//T2p
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
//data.setCategory_name("T2P Compliance");
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_t2p));
|
||||
data.setCategory_img(R.mipmap.t2p_compliance);
|
||||
|
||||
if (db.isFilledT2P(store_id, categoryId)) {
|
||||
data.setCategory_img(R.mipmap.t2p_compliance_done);
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.t2p_compliance);
|
||||
}
|
||||
|
||||
categoryList.add(data);
|
||||
//T2p added
|
||||
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
//data.setCategory_name("Additional Visibility");
|
||||
|
||||
+6
-3
@@ -6,7 +6,9 @@ package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
public class CategoryGetterSetter {
|
||||
|
||||
String category_id, category, category_img;
|
||||
String category_id, category;
|
||||
|
||||
int category_img;
|
||||
|
||||
public String getCategory_id() {
|
||||
return category_id;
|
||||
@@ -24,11 +26,12 @@ public class CategoryGetterSetter {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public String getCategory_img() {
|
||||
|
||||
public int getCategory_img() {
|
||||
return category_img;
|
||||
}
|
||||
|
||||
public void setCategory_img(String category_img) {
|
||||
public void setCategory_img(int category_img) {
|
||||
this.category_img = category_img;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<?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.SettingsActivity">
|
||||
|
||||
<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_settings" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
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>
|
||||
@@ -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.SettingsActivityFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:layout="@layout/fragment_settings" />
|
||||
@@ -0,0 +1,112 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="cpm.com.gskmtorange.fragment.SelectLanguageFragment">
|
||||
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/content_select_language"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
>
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginTop="20dp"
|
||||
card_view:cardBackgroundColor="@color/white"
|
||||
card_view:cardCornerRadius="5dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ans_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- <TextView
|
||||
android:id="@+id/tv_qns"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:gravity="center"
|
||||
android:padding="5dp"
|
||||
android:text="Alert"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="@dimen/text_size_normal"
|
||||
android:textStyle="bold" />-->
|
||||
|
||||
<TextView
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingLeft="30dp"
|
||||
android:paddingRight="30dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="@string/select_language"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="@dimen/text_size_normal"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="20dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_language_one"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="80dp"
|
||||
android:paddingRight="80dp"
|
||||
android:text="English" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_language_two"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="80dp"
|
||||
android:paddingRight="80dp"
|
||||
android:text="English" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
@@ -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_settings"
|
||||
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:showIn="@layout/activity_settings">
|
||||
|
||||
<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/entry_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.SettingsActivity">
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:orderInCategory="100"
|
||||
android:title="@string/action_settings"
|
||||
app:showAsAction="never" />
|
||||
</menu>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
@@ -118,4 +118,6 @@
|
||||
<string name="Photo">Fotoğraf</string>
|
||||
<string name="title_activity_Additional_visibility">Ek Teşhir</string>
|
||||
|
||||
<string name="select_language_item">Dil Seçimi</string>
|
||||
|
||||
</resources>
|
||||
@@ -37,7 +37,7 @@
|
||||
<string name="cancel">Cancel</string>
|
||||
|
||||
<string name="select_language">Please select language</string>
|
||||
<string name="title_activity_select_language">SelectLanguageActivity</string>
|
||||
<string name="title_activity_select_language">Select Language</string>
|
||||
|
||||
<string name="title_activity_store_list_geotag">Store List</string>
|
||||
|
||||
@@ -160,6 +160,12 @@
|
||||
|
||||
<!--Gagan start new code 2-->
|
||||
<string name="stock_facing_planogram_dialog_title">Planogram</string>
|
||||
<string name="title_activity_settings">SettingsActivity</string>
|
||||
<!--Gagan end new code 2-->
|
||||
|
||||
<string name="select_language_item">Select language</string>
|
||||
|
||||
<!-- TODO: Remove or change this placeholder text -->
|
||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user