Merge pull request #73 from CPM-INDIA-SALES-AND-MARKETING-PVT-LTD/ysy_temp_f

T2P upload data newss
This commit is contained in:
YadavendraSinghYaduvanshi
2017-01-19 15:08:59 +05:30
committed by GitHub
9 changed files with 122 additions and 24 deletions
+16 -7
View File
@@ -31,7 +31,8 @@
<activity
android:name=".LoginActivity"
android:label="@string/title_activity_login"
android:theme="@style/AppTheme.NoActionBar" />
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".MainActivity"
android:label="@string/main_menu_activity_name"
@@ -43,7 +44,8 @@
<activity
android:name=".SelectLanguageActivity"
android:label="@string/title_activity_select_language"
android:theme="@style/AppTheme.NoActionBar" />
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".download.DownloadActivity"
android:screenOrientation="portrait" />
@@ -89,19 +91,23 @@
android:name=".gsk_dailyentry.CategoryListActivity"
android:configChanges="screenSize|orientation|keyboardHidden"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" />
android:windowSoftInputMode="adjustPan"
android:screenOrientation="portrait"/>
<activity
android:name=".gsk_dailyentry.CategoryWisePerformanceActivity"
android:configChanges="screenSize|orientation|keyboardHidden"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" />
android:windowSoftInputMode="adjustPan"
/>
<activity
android:name=".gsk_dailyentry.DailyDataMenuActivity"
android:configChanges="screenSize|orientation|keyboardHidden"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".gsk_dailyentry.MSL_AvailabilityActivity"
android:configChanges="screenSize|orientation|keyboardHidden"
@@ -148,15 +154,18 @@
<activity
android:name=".dailyentry.SettingsActivity"
android:label="@string/title_activity_settings"
android:theme="@style/AppTheme.NoActionBar" />
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".dailyentry.CheckoutActivity"
android:label="@string/title_activity_checkout"
android:theme="@style/AppTheme.NoActionBar" />
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".dailyentry.ServiceActivity"
android:label="@string/title_activity_service"
android:theme="@style/AppTheme.NoActionBar"></activity>
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"></activity>
</application>
</manifest>
@@ -135,15 +135,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
db.delete(CommonString.CREATE_TABLE_STOCK_DIALOG, CommonString.KEY_STORE_ID + "='" + storeid + "'", null);
db.delete(CommonString.CREATE_TABLE_STOCK_ADDITIONAL_STOCK_DATA, CommonString.KEY_STORE_ID + "='" + storeid + "'", null);
db.delete(CommonString.TABLE_COVERAGE_DATA, CommonString.KEY_STORE_ID + "='" + storeid + "'", null);
db.delete(CommonString.TABLE_COVERAGE_DATA, CommonString.KEY_STORE_ID + "='" + storeid + "'", null);
db.delete(CommonString.TABLE_COVERAGE_DATA, CommonString.KEY_STORE_ID + "='" + storeid + "'", null);
db.delete(CommonString.TABLE_COVERAGE_DATA, CommonString.KEY_STORE_ID + "='" + storeid + "'", null);
db.delete(CommonString.TABLE_COVERAGE_DATA, CommonString.KEY_STORE_ID + "='" + storeid + "'", null);
db.delete(CommonString.TABLE_COVERAGE_DATA, CommonString.KEY_STORE_ID + "='" + storeid + "'", null);
//Gagan start code
db.delete(CommonString.TABLE_INSERT_MSL_AVAILABILITY, "Store_Id='" + storeid + "'", null);
db.delete(CommonString.TABLE_INSERT_STOCK_FACING_HEADER, "Store_Id='" + storeid + "'", null);
@@ -151,6 +142,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
db.delete(CommonString.TABLE_INSERT_ADDITIONAL_PROMO_COMPLIANCE, "STORE_ID='" + storeid + "'", null);
db.delete(CommonString.TABLE_INSERT_PROMO_SKU, "STORE_ID='" + storeid + "'", null);
//Gagan end code
}
public void deleteAllTables() {
@@ -52,6 +52,7 @@ import cpm.com.gskmtorange.R;
import cpm.com.gskmtorange.constant.CommonString;
import cpm.com.gskmtorange.download.DownloadActivity;
import cpm.com.gskmtorange.gsk_dailyentry.CategoryListActivity;
import cpm.com.gskmtorange.gsk_dailyentry.StoreWisePerformanceActivity;
/**
* Created by ashishc on 29-12-2016.
@@ -469,7 +470,7 @@ public class StoreListActivity extends AppCompatActivity {
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
dialog.cancel();
} else {
Intent in = new Intent(StoreListActivity.this, CategoryListActivity.class);
Intent in = new Intent(StoreListActivity.this, StoreWisePerformanceActivity.class);
startActivity(in);
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
dialog.cancel();
@@ -7,10 +7,13 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Typeface;
import android.graphics.drawable.ColorDrawable;
@@ -33,6 +36,9 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
@@ -59,8 +65,10 @@ import cpm.com.gskmtorange.R;
import cpm.com.gskmtorange.constant.CommonString;
import cpm.com.gskmtorange.fonts.FontManager;
import cpm.com.gskmtorange.fonts.TextDrawable;
import cpm.com.gskmtorange.gsk_dailyentry.Stock_FacingActivity;
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.GapsChecklistGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_DataGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
@@ -116,7 +124,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
rec_t2p = (RecyclerView) findViewById(R.id.rec_t2p);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@@ -168,6 +176,16 @@ public class T2PComplianceActivity extends AppCompatActivity {
}
rec_t2p.addOnScrollListener(new RecyclerView.OnScrollListener(){
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy){
if (dy > 0)
fab.hide();
else if (dy < 0)
fab.show();
}
});
}
@Override
@@ -253,7 +271,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
holder.btn_ref_img.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showPlanogram(mItem.getRef_image_url());
}
});
@@ -978,4 +996,64 @@ public class T2PComplianceActivity extends AppCompatActivity {
return true;
}
public void showPlanogram(String planogram_image){
final Dialog dialog = new Dialog(T2PComplianceActivity.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
//dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
dialog.setContentView(R.layout.planogram_dialog_layout);
dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
dialog.setCancelable(false);
//ArrayList<MAPPING_PLANOGRAM_DataGetterSetter> mp = db.getMappingPlanogramData("");
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
WebView webView = (WebView) dialog.findViewById(R.id.webview);
webView.setWebViewClient(new MyWebViewClient());
webView.getSettings().setAllowFileAccess(true);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setBuiltInZoomControls(true);
//String planogram_image = mp.get(0).getPLANOGRAM_IMAGE();
if (new File(str + planogram_image).exists()) {
String imagePath = "file://" + CommonString.FILE_PATH + "/" + planogram_image;
String html = "<html><head></head><body><img src=\"" + imagePath + "\"></body></html>";
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
dialog.show();
}
ImageView cancel = (ImageView) dialog.findViewById(R.id.img_cancel);
cancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
dialog.dismiss();
}
});
}
private class MyWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
view.clearCache(true);
}
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
}
}
}
@@ -85,6 +85,7 @@ public class CategoryWisePerformanceActivity extends AppCompatActivity {
intent.putExtra("categoryName", categoryName);
intent.putExtra("categoryId", categoryId);
startActivity(intent);
finish();
}
});
} catch (Resources.NotFoundException e) {
@@ -103,6 +103,7 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
public void onClick(View view) {
Intent intent = new Intent(StoreWisePerformanceActivity.this, CategoryListActivity.class);
startActivity(intent);
finish();
}
});
} catch (Resources.NotFoundException e) {
@@ -953,7 +953,7 @@ public class UploadActivity extends AppCompatActivity {
}
///////close store images
//T2p Images
for (int m = 0; m < t2PGetterSetters.size(); m++) {
@@ -1046,7 +1046,7 @@ public class UploadActivity extends AppCompatActivity {
if (result.equals("")) {
showAlert(getString(R.string.menu_upload_data));
finish();
}
}
}
@@ -1101,4 +1101,22 @@ public class UploadActivity extends AppCompatActivity {
return true;
}
public void showAlert(String str) {
AlertDialog.Builder builder = new AlertDialog.Builder(UploadActivity.this);
builder.setTitle("Parinaam");
builder.setMessage(str).setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
/* Intent i = new Intent(activity, StorelistActivity.class);
activity.startActivity(i);
activity.finish();*/
finish();
}
});
AlertDialog alert = builder.create();
alert.show();
}
}
@@ -127,9 +127,6 @@
<string name="title_activity_click_delete">Silme için Evet tıklayın</string>
<string name="title_activity_select_dropdown">Please Select dropdown</string>
<string name="export_database">Veritabanı Aktar</string>
<string name="title_activity_service">Servisler</string>
@@ -13,6 +13,7 @@
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />