Commit First New

Commit First New
This commit is contained in:
vinayvekkot-cpm
2016-12-27 12:14:33 +05:30
commit 849533a02b
80 changed files with 3376 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cpm.com.gskmtorange">
<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".SplashScreenActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".LoginActivity"
android:label="@string/title_activity_login"
android:theme="@style/AppTheme.NoActionBar"/>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar" />
<activity android:name=".autoupdate.AutoUpdateActivity" />
<activity
android:name=".SelectLanguageActivity"
android:label="@string/title_activity_select_language"
android:theme="@style/AppTheme.NoActionBar"></activity>
</application>
</manifest>
@@ -0,0 +1,639 @@
package cpm.com.gskmtorange;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationListener;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.EditorInfo;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
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;
import org.ksoap2.transport.HttpTransportSE;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
import java.io.IOException;
import java.io.StringReader;
import java.net.MalformedURLException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.List;
import cpm.com.gskmtorange.autoupdate.AutoUpdateActivity;
import cpm.com.gskmtorange.constant.CommonString;
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
import static android.Manifest.permission.READ_CONTACTS;
import static android.R.attr.versionCode;
/**
* A login screen that offers login via userid/password.
*/
public class LoginActivity extends AppCompatActivity {
TextView tv_version;
String app_ver;
LoginGetterSetter lgs = null;
static int counter = 1;
private SharedPreferences preferences = null;
private SharedPreferences.Editor editor = null;
/**
* Id to identity READ_CONTACTS permission request.
*/
private static final int REQUEST_READ_CONTACTS = 0;
/**
* A dummy authentication store containing known user names and passwords.
* TODO: remove after connecting to a real authentication system.
*/
private static final String[] DUMMY_CREDENTIALS = new String[]{
"foo@example.com:hello", "bar@example.com:world"
};
String lat = "0.0";
String lon = "0.0";
// UI references.
private AutoCompleteTextView museridView;
private EditText mPasswordView;
private View mProgressView;
private View mLoginFormView;
private String userid, password, p_username, p_password;
private int versionCode;
int eventType;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
preferences = PreferenceManager.getDefaultSharedPreferences(this);
editor = preferences.edit();
// Set up the login form.
museridView = (AutoCompleteTextView) findViewById(R.id.userid);
//populateAutoComplete();
mPasswordView = (EditText) findViewById(R.id.password);
mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
if (id == R.id.login || id == EditorInfo.IME_NULL) {
attemptLogin();
return true;
}
return false;
}
});
try {
app_ver = String.valueOf(getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
// tv_version.setText("Version " + app_ver);
} catch (PackageManager.NameNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Button museridSignInButton = (Button) findViewById(R.id.user_login_button);
museridSignInButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
attemptLogin();
}
});
mLoginFormView = findViewById(R.id.login_form);
mProgressView = findViewById(R.id.login_progress);
}
/* private void populateAutoComplete() {
if (!mayRequestContacts()) {
return;
}
getLoaderManager().initLoader(0, null, this);
}*/
private boolean mayRequestContacts() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
return true;
}
if (checkSelfPermission(READ_CONTACTS) == PackageManager.PERMISSION_GRANTED) {
return true;
}
if (shouldShowRequestPermissionRationale(READ_CONTACTS)) {
Snackbar.make(museridView, R.string.permission_rationale, Snackbar.LENGTH_INDEFINITE)
.setAction(android.R.string.ok, new View.OnClickListener() {
@Override
@TargetApi(Build.VERSION_CODES.M)
public void onClick(View v) {
requestPermissions(new String[]{READ_CONTACTS}, REQUEST_READ_CONTACTS);
}
});
} else {
requestPermissions(new String[]{READ_CONTACTS}, REQUEST_READ_CONTACTS);
}
return false;
}
/**
* Callback received when a permissions request has been completed.
*/
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
@NonNull int[] grantResults) {
if (requestCode == REQUEST_READ_CONTACTS) {
if (grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
//populateAutoComplete();
}
}
}
/**
* Attempts to sign in or register the account specified by the login form.
* If there are form errors (invalid userid, missing fields, etc.), the
* errors are presented and no actual login attempt is made.
*/
private void attemptLogin() {
/* if (mAuthTask != null) {
return;
}
*/
// Reset errors.
museridView.setError(null);
mPasswordView.setError(null);
// Store values at the time of the login attempt.
userid = museridView.getText().toString();
password = mPasswordView.getText().toString();
boolean cancel = false;
View focusView = null;
// Check for a valid password, if the user entered one.
if (!TextUtils.isEmpty(password) && !isPasswordValid(password)) {
mPasswordView.setError(getString(R.string.error_invalid_password));
focusView = mPasswordView;
cancel = true;
}
// Check for a valid userid address.
if (TextUtils.isEmpty(userid)) {
museridView.setError(getString(R.string.error_field_required));
focusView = museridView;
cancel = true;
} /*else if (!isuseridValid(userid)) {
museridView.setError(getString(R.string.error_invalid_userid));
focusView = museridView;
cancel = true;
}*/
if (cancel) {
// There was an error; don't attempt login and focus the first
// form field with an error.
focusView.requestFocus();
} else {
// Show a progress spinner, and kick off a background task to
// perform the user login attempt.
//showProgress(true);
/* mAuthTask = new UserLoginTask(userid, password);
mAuthTask.execute((Void) null);*/
new AuthenticateTask().execute();
}
}
private boolean isuseridValid(String userid) {
//TODO: Replace this with your own logic
return userid.contains("@");
}
private boolean isPasswordValid(String password) {
//TODO: Replace this with your own logic
return password.length() > 4;
}
/**
* Shows the progress UI and hides the login form.
*/
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
private void showProgress(final boolean show) {
// On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow
// for very easy animations. If available, use these APIs to fade-in
// the progress spinner.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);
mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);
mLoginFormView.animate().setDuration(shortAnimTime).alpha(
show ? 0 : 1).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);
}
});
mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
mProgressView.animate().setDuration(shortAnimTime).alpha(
show ? 1 : 0).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
}
});
} else {
// The ViewPropertyAnimator APIs are not available, so simply show
// and hide the relevant UI components.
mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);
}
}
/* @Override
public Loader<Cursor> onCreateLoader(int i, Bundle bundle) {
return new CursorLoader(this,
// Retrieve data rows for the device user's 'profile' contact.
Uri.withAppendedPath(ContactsContract.Profile.CONTENT_URI,
ContactsContract.Contacts.Data.CONTENT_DIRECTORY), ProfileQuery.PROJECTION,
// Select only userid addresses.
ContactsContract.Contacts.Data.MIMETYPE +
" = ?", new String[]{ContactsContract.CommonDataKinds.userid
.CONTENT_ITEM_TYPE},
// Show primary userid addresses first. Note that there won't be
// a primary userid address if the user hasn't specified one.
ContactsContract.Contacts.Data.IS_PRIMARY + " DESC");
}
@Override
public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) {
List<String> userids = new ArrayList<>();
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
userids.add(cursor.getString(ProfileQuery.ADDRESS));
cursor.moveToNext();
}
adduseridsToAutoComplete(userids);
}
@Override
public void onLoaderReset(Loader<Cursor> cursorLoader) {
}*/
private void adduseridsToAutoComplete(List<String> useridAddressCollection) {
//Create adapter to tell the AutoCompleteTextView what to show in its dropdown list.
ArrayAdapter<String> adapter =
new ArrayAdapter<>(LoginActivity.this,
android.R.layout.simple_dropdown_item_1line, useridAddressCollection);
museridView.setAdapter(adapter);
}
/* private interface ProfileQuery {
String[] PROJECTION = {
ContactsContract.CommonDataKinds.userid.ADDRESS,
ContactsContract.CommonDataKinds.userid.IS_PRIMARY,
};
int ADDRESS = 0;
int IS_PRIMARY = 1;
}*/
/**
* Represents an asynchronous login/registration task used to authenticate
* the user.
*/
private class AuthenticateTask extends AsyncTask<Void, Void, String> {
private ProgressDialog dialog = null;
@Override
protected void onPreExecute() {
super.onPreExecute();
dialog = new ProgressDialog(LoginActivity.this);
dialog.setTitle("Login");
dialog.setMessage("Authenticating....");
dialog.setCancelable(false);
dialog.show();
}
@Override
protected String doInBackground(Void... params) {
try {
versionCode = getPackageManager().getPackageInfo(
getPackageName(), 0).versionCode;
String userauth_xml = "[DATA]" + "[USER_DATA][USER_ID]"
+ userid + "[/USER_ID]" + "[PASSWORD]" + password
+ "[/PASSWORD]" + "[IN_TIME]" + getCurrentTime()
+ "[/IN_TIME]" + "[LATITUDE]" + lat
+ "[/LATITUDE]" + "[LONGITUDE]" + lon
+ "[/LONGITUDE]" + "[APP_VERSION]" + app_ver
+ "[/APP_VERSION]" + "[ATT_MODE]OnLine[/ATT_MODE]"
+ "[NETWORK_STATUS]" + "LoginStatus"
+ "[/NETWORK_STATUS]" + "[/USER_DATA][/DATA]";
SoapObject request = new SoapObject(CommonString.NAMESPACE,
CommonString.METHOD_LOGIN);
request.addProperty("onXML", userauth_xml);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(
CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_LOGIN,
envelope);
Object result = (Object) envelope.getResponse();
if (result.toString()
.equalsIgnoreCase(CommonString.KEY_FAILURE)) {
runOnUiThread(new Runnable() {
@Override
public void run() {
showAlert(CommonString.MESSAGE_FAILURE);
}
});
} else if (result.toString().equalsIgnoreCase(
CommonString.KEY_FALSE)) {
runOnUiThread(new Runnable() {
@Override
public void run() {
showAlert(CommonString.MESSAGE_FALSE);
}
});
} else if (result.toString().equalsIgnoreCase(
CommonString.KEY_CHANGED)) {
runOnUiThread(new Runnable() {
@Override
public void run() {
showAlert(CommonString.MESSAGE_CHANGED);
}
});
} else {
XmlPullParserFactory factory = XmlPullParserFactory
.newInstance();
factory.setNamespaceAware(true);
XmlPullParser xpp = factory.newPullParser();
xpp.setInput(new StringReader(result.toString()));
xpp.next();
eventType = xpp.getEventType();
final FailureGetterSetter failureGetterSetter = XMLHandlers
.failureXMLHandler(xpp, eventType);
if (failureGetterSetter.getStatus().equalsIgnoreCase(
CommonString.KEY_FAILURE)) {
/* final AlertMessage message = new AlertMessage(
LoginActivity.this, CommonString.METHOD_LOGIN
+ failureGetterSetter.getErrorMsg(),
"login", null);*/
runOnUiThread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
showAlert(CommonString.METHOD_LOGIN
+ failureGetterSetter.getErrorMsg());
}
});
} else {
try {
// For String source
xpp.setInput(new StringReader(result.toString()));
xpp.next();
eventType = xpp.getEventType();
lgs = XMLHandlers.loginXMLHandler(xpp, eventType);
} catch (XmlPullParserException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
// PUT IN PREFERENCES
editor.putString(CommonString.KEY_USERNAME, userid);
editor.putString(CommonString.KEY_PASSWORD, password);
editor.putString(CommonString.KEY_VERSION, lgs.getAPP_VERSION());
editor.putString(CommonString.KEY_PATH, lgs.getAPP_PATH());
editor.putString(CommonString.KEY_DATE, lgs.getCURRENTDATE());
editor.commit();
return CommonString.KEY_SUCCESS;
}
}
return "";
} catch (MalformedURLException e) {
/* final AlertMessage message = new AlertMessage(
LoginActivity.this, AlertMessage.MESSAGE_EXCEPTION,
"acra_login", e);*/
runOnUiThread(new Runnable() {
@Override
public void run() {
showAlert(CommonString.MESSAGE_EXCEPTION);
}
});
} catch (IOException e) {
/* final AlertMessage message = new AlertMessage(
LoginActivity.this,
AlertMessage.MESSAGE_SOCKETEXCEPTION, "socket_login", e);*/
counter++;
runOnUiThread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
if (counter < 3) {
new AuthenticateTask().execute();
} else {
showAlert(CommonString.MESSAGE_SOCKETEXCEPTION);
counter = 1;
}
}
});
} catch (Exception e) {
/* final AlertMessage message = new AlertMessage(
LoginActivity.this, AlertMessage.MESSAGE_EXCEPTION,
"acra_login", e);*/
runOnUiThread(new Runnable() {
@Override
public void run() {
showAlert(CommonString.MESSAGE_EXCEPTION);
}
});
}
return "";
}
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
if (result.equals(CommonString.KEY_SUCCESS)) {
// database.open();
if (preferences.getString(CommonString.KEY_VERSION, "").equals(
Integer.toString(versionCode))) {
if(preferences.getString(CommonString.KEY_LANGUAGE, "").equals("")){
Intent intent = new Intent(getBaseContext(),
SelectLanguageActivity.class);
intent.putExtra(CommonString.KEY_LOGIN_DATA, lgs);
startActivity(intent);
finish();
}
else{
Intent intent = new Intent(getBaseContext(),
MainActivity.class);
startActivity(intent);
finish();
}
} else {
Intent intent = new Intent(getBaseContext(),
AutoUpdateActivity.class);
intent.putExtra(CommonString.KEY_PATH,
preferences.getString(CommonString.KEY_PATH, ""));
startActivity(intent);
finish();
}
}
dialog.dismiss();
}
}
public void showAlert(String str) {
AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.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();*/
}
});
AlertDialog alert = builder.create();
alert.show();
}
public String getCurrentTime() {
Calendar m_cal = Calendar.getInstance();
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
String intime = formatter.format(m_cal.getTime());
/* String intime = m_cal.get(Calendar.HOUR_OF_DAY) + ":"
+ m_cal.get(Calendar.MINUTE) + ":" + m_cal.get(Calendar.SECOND);*/
return intime;
}
}
@@ -0,0 +1,177 @@
package cpm.com.gskmtorange;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.view.LayoutInflater;
import android.view.View;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.TextView;
import cpm.com.gskmtorange.constant.CommonString;
public class MainActivity extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
WebView webView;
ImageView imageView;
private SharedPreferences preferences = null;
String user_name, user_type;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
preferences = PreferenceManager.getDefaultSharedPreferences(this);
imageView = (ImageView) findViewById(R.id.img_main);
webView = (WebView) findViewById(R.id.webview);
String url = preferences.getString(CommonString.KEY_NOTICE_BOARD_LINK,"");
user_name = preferences.getString(CommonString.KEY_USERNAME, null);
//user_type = preferences.getString(CommonString.KEY_USER_TYPE, null);
webView.setWebViewClient(new MyWebViewClient());
webView.getSettings().setJavaScriptEnabled(true);
if(!url.equals("")){
webView.loadUrl(url);
}
/* 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();
}
});
*/
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.setDrawerListener(toggle);
toggle.syncState();
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
View headerView = LayoutInflater.from(this).inflate(R.layout.nav_header_main, navigationView, false);
TextView tv_username = (TextView) headerView.findViewById(R.id.nav_user_name);
//tv_usertype = (TextView) headerView.findViewById(R.id.nav_user_type);
tv_username.setText(user_name);
//tv_usertype.setText(user_type);
navigationView.addHeaderView(headerView);
navigationView.setNavigationItemSelectedListener(this);
}
@Override
public void onBackPressed() {
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
if (drawer.isDrawerOpen(GravityCompat.START)) {
drawer.closeDrawer(GravityCompat.START);
} else {
super.onBackPressed();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@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();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
@SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
// Handle navigation view item clicks here.
int id = item.getItemId();
if (id == R.id.nav_route_plan) {
// Handle the camera action
} else if (id == R.id.nav_download) {
} else if (id == R.id.nav_upload) {
} else if (id == R.id.nav_geotag) {
} else if (id == R.id.nav_exit) {
} else if (id == R.id.nav_services) {
}else if (id == R.id.nav_setting) {
}
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}
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) {
/* progress.setVisibility(View.GONE);
WebViewActivity.this.progress.setProgress(100);*/
imageView.setVisibility(View.INVISIBLE);
webView.setVisibility(View.VISIBLE);
super.onPageFinished(view, url);
view.clearCache(true);
}
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
/* progress.setVisibility(View.VISIBLE);
WebViewActivity.this.progress.setProgress(0);*/
super.onPageStarted(view, url, favicon);
}
}
}
@@ -0,0 +1,149 @@
package cpm.com.gskmtorange;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Color;
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.View;
import android.widget.Button;
import java.util.ArrayList;
import java.util.Locale;
import cpm.com.gskmtorange.constant.CommonString;
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
public class SelectLanguageActivity extends AppCompatActivity implements View.OnClickListener{
Button btn_lang_1, btn_lang_2;
private SharedPreferences preferences = null;
private SharedPreferences.Editor editor = null;
LoginGetterSetter login_data;
ArrayList<String> language;
boolean selected_flag = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_select_language);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
preferences = PreferenceManager.getDefaultSharedPreferences(this);
editor = preferences.edit();
btn_lang_1 = (Button) findViewById(R.id.btn_language_one);
btn_lang_2 = (Button) findViewById(R.id.btn_language_two);
login_data = (LoginGetterSetter) getIntent().getSerializableExtra(CommonString.KEY_LOGIN_DATA);
language = login_data.getCULTURE_NAME();
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);
}
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(selected_flag){
Intent intent = new Intent(getBaseContext(),
MainActivity.class);
intent.putExtra(CommonString.KEY_LOGIN_DATA, login_data);
startActivity(intent);
}
else {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
}
});
}
@Override
public void onClick(View view) {
int id = view.getId();
switch (id){
case R.id.btn_language_one:
selected_flag = true;
updateResources(getApplicationContext(),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_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(0));
editor.commit();
break;
case R.id.btn_language_two:
selected_flag = true;
updateResources(getApplicationContext(),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_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(1));
editor.commit();
break;
}
}
private static boolean updateResources(Context context, String language) {
String lang ;
if(language.equals("English")){
lang = "EN";
}
else if(language.equals("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,86 @@
package cpm.com.gskmtorange;
import android.content.Intent;
import android.graphics.PixelFormat;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Window;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.LinearLayout;
public class SplashScreenActivity extends AppCompatActivity {
private static int SPLASH_TIME_OUT = 3000;
public void onAttachedToWindow() {
super.onAttachedToWindow();
Window window = getWindow();
window.setFormat(PixelFormat.RGBA_8888);
}
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
StartAnimations();
new Handler().postDelayed(new Runnable() {
/*
* Showing splash screen with a timer. This will be useful when you
* want to show case your app logo / company
*/
@Override
public void run() {
// This method will be executed once the timer is over
// Start your app main activity
/* SharedPreferences sharedpreferences = getSharedPreferences("MyPref", Context.MODE_PRIVATE);
boolean isLoggedIn = sharedpreferences.getBoolean("isLoggedIn", false);
if (isLoggedIn) {
Intent i = new Intent(SplashScreenActivity.this, LoginActivity.class);
startActivity(i);
} else {
Intent i = new Intent(SplashScreenActivity.this, LoginActivity.class);
startActivity(i);
}*/
// close this activity
Intent i = new Intent(SplashScreenActivity.this, LoginActivity.class);
startActivity(i);
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
finish();
}
}, SPLASH_TIME_OUT);
}
private void StartAnimations() {
Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha);
anim.reset();
LinearLayout l=(LinearLayout) findViewById(R.id.lin_lay);
l.clearAnimation();
l.startAnimation(anim);
anim = AnimationUtils.loadAnimation(this, R.anim.translate);
anim.reset();
ImageView iv = (ImageView) findViewById(R.id.logo);
iv.clearAnimation();
iv.startAnimation(anim);
}
}
@@ -0,0 +1,282 @@
package cpm.com.gskmtorange.autoupdate;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Environment;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ProgressBar;
import android.widget.TextView;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.DecimalFormat;
import cpm.com.gskmtorange.LoginActivity;
import cpm.com.gskmtorange.R;
import cpm.com.gskmtorange.constant.CommonString;
public class AutoUpdateActivity extends AppCompatActivity {
String versionCode;
int length;
private Dialog dialog;
private ProgressBar pb;
private TextView percentage, message;
private Data data;
String path = "", p, s;
ProgressBar progressBar;
private boolean status;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
Intent intent = getIntent();
path = intent.getStringExtra(CommonString.KEY_PATH);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Parinaam");
builder.setMessage("New Update Available.")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
SharedPreferences preferences = PreferenceManager
.getDefaultSharedPreferences(AutoUpdateActivity.this);
SharedPreferences.Editor editor = preferences.edit();
editor.clear();
editor.commit();
/*new File(
"/data/data/com.cpm.gsk_mt/databases/GTMT_DATABASE")
.delete();*/
new DownloadTask(AutoUpdateActivity.this).execute();
}
});
AlertDialog alert = builder.create();
alert.show();
}
private class DownloadTask extends AsyncTask<Void, Data, String> {
private Context context;
DownloadTask(Context context) {
this.context = context;
}
@Override
protected void onPreExecute() {
super.onPreExecute();
dialog = new Dialog(context);
dialog.setContentView(R.layout.custom_layout);
dialog.setTitle("Download");
dialog.setCancelable(false);
dialog.show();
pb = (ProgressBar) dialog.findViewById(R.id.progressBar1);
percentage = (TextView) dialog.findViewById(R.id.percentage);
message = (TextView) dialog.findViewById(R.id.message);
}
@Override
protected String doInBackground(Void... params) {
try {
data = new Data();
data.name = "Downloading Application";
publishProgress(data);
versionCode = getPackageManager().getPackageInfo(
getPackageName(), 0).versionName;
data.name = "Upgraditing Version : " + versionCode;
publishProgress(data);
// download application
URL url = new URL(path);
HttpURLConnection c = (HttpURLConnection) url.openConnection();
c.setRequestMethod("GET");
// c.setDoOutput(true);
c.getResponseCode();
c.connect();
length = c.getContentLength();
String size = new DecimalFormat("##.##")
.format((double) ((double) length / 1024) / 1024)
+ " MB";
String PATH = Environment.getExternalStorageDirectory()
+ "/download/";
File file = new File(PATH);
file.mkdirs();
File outputFile = new File(file, "app.apk");
FileOutputStream fos = new FileOutputStream(outputFile);
InputStream is = c.getInputStream();
int bytes = 0;
byte[] buffer = new byte[1024];
int len1 = 0;
while ((len1 = is.read(buffer)) != -1) {
bytes = (bytes + len1);
s = new DecimalFormat("##.##")
.format((double) ((double) (bytes / 1024)) / 1024);
p = s.length() == 3 ? s + "0" : s;
p = p + " MB";
data.value = (int) ((double) (((double) bytes) / length) * 100);
data.name = "Download " + p + "/" + size;
publishProgress(data);
fos.write(buffer, 0, len1);
}
fos.close();
is.close();
return CommonString.KEY_SUCCESS;
} catch (PackageManager.NameNotFoundException e) {
// TODO Auto-generated catch block
/* final AlertMessage message = new AlertMessage(
AutoUpdateActivity.this,
AlertMessage.MESSAGE_EXCEPTION, "download", e);*/
runOnUiThread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
showAlert(CommonString.MESSAGE_EXCEPTION);
}
});
} catch (MalformedURLException e) {
/* final AlertMessage message = new AlertMessage(
AutoUpdateActivity.this,
AlertMessage.MESSAGE_EXCEPTION, "download", e);*/
runOnUiThread(new Runnable() {
@Override
public void run() {
showAlert(CommonString.MESSAGE_EXCEPTION);
}
});
} catch (IOException e) {
/* final AlertMessage message = new AlertMessage(
AutoUpdateActivity.this,
AlertMessage.MESSAGE_SOCKETEXCEPTION, "update", e);*/
runOnUiThread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
showAlert(CommonString.MESSAGE_SOCKETEXCEPTION);
}
});
} catch (Exception e) {
/* final AlertMessage message = new AlertMessage(
AutoUpdateActivity.this,
AlertMessage.MESSAGE_EXCEPTION, "download", e);*/
runOnUiThread(new Runnable() {
@Override
public void run() {
showAlert(CommonString.MESSAGE_EXCEPTION);
}
});
}
return "";
}
@Override
protected void onProgressUpdate(Data... values) {
// TODO Auto-generated method stub
pb.setProgress(values[0].value);
percentage.setText(values[0].value + "%");
message.setText(values[0].name);
}
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
dialog.dismiss();
if (result.equals(CommonString.KEY_SUCCESS)) {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setDataAndType(Uri.fromFile(new File(Environment
.getExternalStorageDirectory()
+ "/download/"
+ "app.apk")),
"application/vnd.android.package-archive");
startActivity(i);
AutoUpdateActivity.this.finish();
}
}
}
class Data {
int value;
String name;
}
public void showAlert(String str) {
AlertDialog.Builder builder = new AlertDialog.Builder(AutoUpdateActivity.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();*/
}
});
AlertDialog alert = builder.create();
alert.show();
}
}
@@ -0,0 +1,49 @@
package cpm.com.gskmtorange.constant;
/**
* Created by yadavendras on 19-12-2016.
*/
public class CommonString {
// webservice constants
// preferenec keys
public static final String KEY_USERNAME = "username";
public static final String KEY_PASSWORD = "password";
public static final String KEY_DATE = "date";
public static final String KEY_PATH = "path";
public static final String KEY_VERSION = "APP_VERSION";
public static final String KEY_LANGUAGE = "LANGUAGE";
public static final String KEY_NOTICE_BOARD_LINK = "NOTICE_BOARD_LINK";
public static final String KEY_LOGIN_DATA = "LOGIN_DATA";
// webservice constants
public static final String KEY_SUCCESS = "Success";
public static final String KEY_FAILURE = "Failure";
public static final String KEY_FALSE = "False";
public static final String KEY_CHANGED = "Changed";
public static final String KEY_NO_DATA = "NODATA";
public static String URL = "http://gskme.parinaam.in/Gskwebservice.asmx";
public static final String NAMESPACE = "http://tempuri.org/";
public static final String METHOD_LOGIN = "UserLoginDetail";
public static final String SOAP_ACTION_LOGIN = "http://tempuri.org/"
+ METHOD_LOGIN;
//Alert Messages
public static final String MESSAGE_FAILURE = "Server Error.Please Access After Some Time";
public static final String MESSAGE_FALSE = "Invalid User";
public static final String MESSAGE_CHANGED = "Invalid UserId Or Password / Password Has Been Changed.";
public static final String MESSAGE_EXCEPTION = "Problem Occured : Report The Problem To Parinaam ";
public static final String MESSAGE_SOCKETEXCEPTION = "Network Communication Failure. Check Your Network Connection";
}
@@ -0,0 +1,24 @@
package cpm.com.gskmtorange.xmlGetterSetter;
public class FailureGetterSetter {
private String status="",errorMsg;
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
}
@@ -0,0 +1,74 @@
package cpm.com.gskmtorange.xmlGetterSetter;
import java.io.Serializable;
import java.util.ArrayList;
/**
* Created by yadavendras on 21-12-2016.
*/
public class LoginGetterSetter implements Serializable{
String RIGHT_NAME, APP_VERSION, APP_PATH, CURRENTDATE;
ArrayList<String> CULTURE_ID = new ArrayList<>();
ArrayList<String> CULTURE_NAME = new ArrayList<>();
ArrayList<String> NOTICE_URL = new ArrayList<>();
public String getRIGHT_NAME() {
return RIGHT_NAME;
}
public void setRIGHT_NAME(String rIGHT_NAME) {
RIGHT_NAME = rIGHT_NAME;
}
public String getAPP_VERSION() {
return APP_VERSION;
}
public void setAPP_VERSION(String aPP_VERSION) {
APP_VERSION = aPP_VERSION;
}
public String getAPP_PATH() {
return APP_PATH;
}
public void setAPP_PATH(String aPP_PATH) {
APP_PATH = aPP_PATH;
}
public String getCURRENTDATE() {
return CURRENTDATE;
}
public void setCURRENTDATE(String cURRENTDATE) {
CURRENTDATE = cURRENTDATE;
}
public ArrayList<String> getCULTURE_ID() {
return CULTURE_ID;
}
public void setCULTURE_ID(String CULTURE_ID) {
this.CULTURE_ID.add(CULTURE_ID);
}
public ArrayList<String> getCULTURE_NAME() {
return CULTURE_NAME;
}
public void setCULTURE_NAME(String CULTURE_NAME) {
this.CULTURE_NAME.add(CULTURE_NAME);
}
public ArrayList<String> getNOTICE_URL() {
return NOTICE_URL;
}
public void setNOTICE_URL(String NOTICE_URL) {
this.NOTICE_URL.add(NOTICE_URL);
}
}
@@ -0,0 +1,88 @@
package cpm.com.gskmtorange.xmlHandlers;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
/**
* Created by yadavendras on 21-12-2016.
*/
public class XMLHandlers {
// FAILURE XML HANDLER
public static FailureGetterSetter failureXMLHandler(XmlPullParser xpp,
int eventType) {
FailureGetterSetter failureGetterSetter = new FailureGetterSetter();
try {
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
if (xpp.getEventType() == XmlPullParser.START_TAG) {
if (xpp.getName().equals("STATUS")) {
failureGetterSetter.setStatus(xpp.nextText());
}
if (xpp.getName().equals("ERRORMSG")) {
failureGetterSetter.setErrorMsg(xpp.nextText());
}
}
xpp.next();
}
} catch (XmlPullParserException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return failureGetterSetter;
}
// LOGIN XML HANDLER
public static LoginGetterSetter loginXMLHandler(XmlPullParser xpp,
int eventType) {
LoginGetterSetter lgs = new LoginGetterSetter();
try {
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
if (xpp.getEventType() == XmlPullParser.START_TAG) {
if (xpp.getName().equals("RIGHT_NAME")) {
lgs.setRIGHT_NAME(xpp.nextText());
}
if (xpp.getName().equals("APP_VERSION")) {
lgs.setAPP_VERSION(xpp.nextText());
}
if (xpp.getName().equals("APP_PATH")) {
lgs.setAPP_PATH(xpp.nextText());
}
if (xpp.getName().equals("CURRENTDATE")) {
lgs.setCURRENTDATE(xpp.nextText());
}
if (xpp.getName().equals("CULTURE_ID")) {
lgs.setCULTURE_ID(xpp.nextText());
}
if (xpp.getName().equals("CULTURE_NAME")) {
lgs.setCULTURE_NAME(xpp.nextText());
}
if (xpp.getName().equals("NOTICE_URL")) {
lgs.setNOTICE_URL(xpp.nextText());
}
}
xpp.next();
}
} catch (XmlPullParserException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return lgs;
}
}
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="-100%"
android:toXDelta="0"
android:duration="200" />
</set>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="0"
android:toXDelta="100%"
android:duration="200" />
</set>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="100%"
android:toXDelta="0"
android:duration="200" />
</set>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="0"
android:toXDelta="-100%"
android:duration="200" />
</set>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<alpha
xmlns:android="http://schemas.android.com/apk/res/android"
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:duration="3000" />
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true">
<!--Move-->
<translate
android:duration="1000"
android:fromXDelta="-150%"
android:fromYDelta="-150%"
android:interpolator="@android:anim/linear_interpolator"
android:toXDelta="0%"
android:toYDelta="0%"></translate>
<!--Fade Out-->
<alpha
android:duration="2000"
android:fromAlpha="1.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:toAlpha="0.0"></alpha>
</set>
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true">
<!-- Rotate -->
<rotate
android:duration="500"
android:fromDegrees="30"
android:interpolator="@android:anim/linear_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="4"
android:repeatMode="reverse"
android:toDegrees="0"></rotate>
<!--Move-->
<translate
android:duration="1000"
android:fromXDelta="150%"
android:fromYDelta="150%"
android:interpolator="@android:anim/linear_interpolator"
android:toXDelta="0%"
android:toYDelta="0%"></translate>
<!--Fade In-->
<alpha
android:duration="2000"
android:fromAlpha="0.0"
android:interpolator="@android:anim/decelerate_interpolator"
android:toAlpha="1.0"></alpha>
</set>
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true">
<!--Move-->
<translate
android:duration="1000"
android:fromXDelta="-170%"
android:fromYDelta="-25%"
android:interpolator="@android:anim/linear_interpolator"
android:toXDelta="0%"
android:toYDelta="0%"></translate>
<!--Fade Out-->
<alpha
android:duration="2000"
android:fromAlpha="1.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:toAlpha="0.0"></alpha>
</set>
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true">
<!-- Rotate -->
<rotate
android:duration="500"
android:fromDegrees="30"
android:interpolator="@android:anim/linear_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="4"
android:repeatMode="reverse"
android:toDegrees="0"></rotate>
<!--Move-->
<translate
android:duration="1000"
android:fromXDelta="170%"
android:fromYDelta="25%"
android:interpolator="@android:anim/linear_interpolator"
android:toXDelta="0%"
android:toYDelta="0%"></translate>
<!--Fade In-->
<alpha
android:duration="2000"
android:fromAlpha="0.0"
android:interpolator="@android:anim/decelerate_interpolator"
android:toAlpha="1.0"></alpha>
</set>
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 - Riccardo Ciovati
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromYDelta="-50%p" android:toYDelta="0" android:duration="200"/>
<alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="200" />
</set>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android">
<translate
xmlns:android="http://schemas.android.com/apk/res/android"
android:fromXDelta="0%"
android:toXDelta="0%"
android:fromYDelta="200%"
android:toYDelta="0%"
android:duration="2000"
android:zAdjustment="top" />
</set>
@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0" />
<path
android:fillColor="#FF000000"
android:pathData="M9,2L7.17,4H4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2H9zm3,15c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z" />
</vector>
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M22,16V4c0,-1.1 -0.9,-2 -2,-2H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2zm-11,-4l2.03,2.71L16,11l4,5H8l3,-4zM2,6v14c0,1.1 0.9,2 2,2h14v-2H4V6H2z" />
</vector>
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M22.7,19l-9.1,-9.1c0.9,-2.3 0.4,-5 -1.5,-6.9 -2,-2 -5,-2.4 -7.4,-1.3L9,6 6,9 1.6,4.7C0.4,7.1 0.9,10.1 2.9,12.1c1.9,1.9 4.6,2.4 6.9,1.5l9.1,9.1c0.4,0.4 1,0.4 1.4,0l2.3,-2.3c0.5,-0.4 0.5,-1.1 0.1,-1.4z" />
</vector>
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z" />
</vector>
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z" />
</vector>
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M4,6H2v14c0,1.1 0.9,2 2,2h14v-2H4V6zm16,-4H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V4c0,-1.1 -0.9,-2 -2,-2zm-8,12.5v-9l6,4.5 -6,4.5z" />
</vector>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item><shape>
<gradient android:angle="90" android:endColor="@color/colorPrimary" android:startColor="#ffffff" android:type="linear" />
</shape></item>
</selector>
Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

@@ -0,0 +1,9 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="135"
android:centerColor="#FFCC80"
android:endColor="#E65100"
android:startColor="@color/colorPrimary"
android:type="linear" />
</shape>
@@ -0,0 +1,13 @@
<?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/activity_auto_update"
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"
tools:context="cpm.com.gskmtorange.autoupdate.AutoUpdateActivity">
</RelativeLayout>
@@ -0,0 +1,239 @@
<!--<LinearLayout 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"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="cpm.com.gskmtorange.LoginActivity">
&lt;!&ndash; Login progress &ndash;&gt;
<ProgressBar
android:id="@+id/login_progress"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:visibility="gone" />
<ScrollView
android:id="@+id/login_form"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/email_login_form"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="@+id/userid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_userid"
android:inputType="textEmailAddress"
android:maxLines="1"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_password"
android:imeActionId="@+id/login"
android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionUnspecified"
android:inputType="textPassword"
android:maxLines="1"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="@+id/user_login_button"
style="?android:textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/action_sign_in"
android:textStyle="bold" />
</LinearLayout>
</ScrollView>
</LinearLayout>-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="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:background="@color/grey_background"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="cpm.com.gskmtorange.LoginActivity">
<!-- Login progress -->
<ProgressBar
android:id="@+id/login_progress"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginBottom="8dp"
/>
<ScrollView
android:id="@+id/login_form"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grey_background">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_centerInParent="true"
android:layout_gravity="center_vertical"
android:background="@drawable/parinaam_logo" />
</RelativeLayout>
<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/email_login_form"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical"
android:paddingBottom="40dp"
android:paddingTop="20dp">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:paddingRight="5dp">
<AutoCompleteTextView
android:id="@+id/userid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_userid"
android:maxLines="1"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:paddingRight="5dp">
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_password"
android:imeActionId="@+id/login"
android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionUnspecified"
android:inputType="textPassword"
android:maxLines="1"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="@+id/user_login_button"
style="?android:textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="16dp"
android:text="@string/action_sign_in"
android:textStyle="bold" />
</LinearLayout>
</android.support.v7.widget.CardView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/gsklogo"
android:layout_width="167dp"
android:layout_height="113dp"
android:layout_centerInParent="true"
android:background="@drawable/gsk_logo"></ImageView>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<TextView
android:id="@+id/tv_version_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="Version"
android:textSize="@dimen/text_size_normal" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
</RelativeLayout>
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout 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/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:menu="@menu/activity_main_drawer" />
</android.support.v4.widget.DrawerLayout>
@@ -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.SelectLanguageActivity"
android:background="@color/grey_background">
<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_select_language" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@drawable/right_arrow" />
</android.support.design.widget.CoordinatorLayout>
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/lin_lay"
tools:context="cpm.com.gskmtorange.SplashScreenActivity"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:background="@drawable/gradient_background"
android:orientation="vertical"
android:weightSum="10">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4">
<ImageView
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="10dp"
android:background="@drawable/parinaam_logo" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="6"
>
<ImageView
android:id="@+id/logo"
android:layout_width="300dp"
android:layout_height="204dp"
android:layout_centerHorizontal="true"
android:background="@drawable/gsk_logo" />
</RelativeLayout>
</LinearLayout>
@@ -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.MainActivity">
<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_main" />
<!-- <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,68 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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/content_main"
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"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="cpm.com.gskmtorange.MainActivity"
tools:showIn="@layout/app_bar_main">
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
card_view:cardBackgroundColor="@color/white"
card_view:cardCornerRadius="5dp" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<!-- <ImageView
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginTop="40dp"
android:src="@drawable/chings"
android:visibility="invisible"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="20dp"
android:src="@drawable/baking_chocolates" />-->
<ImageView
android:id="@+id/img_main"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:src="@drawable/gsk_logo"
/>
<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible"></WebView>
</RelativeLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<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"
tools:context="cpm.com.gskmtorange.SelectLanguageActivity"
tools:showIn="@layout/activity_select_language">
<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:orientation="vertical"
android:layout_centerInParent="true">
<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>
@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:cardview="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
cardview:cardBackgroundColor="@color/white"
cardview:cardCornerRadius="10dp"
>
<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:textColor="@color/colorPrimary"
android:textStyle="bold"
android:textSize="@dimen/text_size_normal"
android:padding="5dp"
android:text="Alert"
android:gravity="center"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:textColor="@color/colorPrimary"
android:textStyle="bold"
android:textSize="@dimen/text_size_normal"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingLeft="30dp"
android:paddingRight="30dp"
android:text="Do you want to save"
android:gravity="center"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RadioGroup
android:id="@+id/radiogrp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_centerInParent="true"
>
<RadioButton
android:id="@+id/rdb_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="language1"
android:padding="5dp"
/>
<RadioButton
android:id="@+id/rdb_two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="language1"
android:padding="5dp"
/>
</RadioGroup>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_centerInParent="true">
<Button
android:id="@+id/btncancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:padding="10dp"
android:text="Cancel"
android:background="@color/colorPrimary"
android:textColor="@color/white"
android:textSize="@dimen/text_size_normal"
/>
<Button
android:id="@+id/btnsubmit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:padding="10dp"
android:text="Submit"
android:background="@color/colorPrimary"
android:textColor="@color/white"
android:textSize="@dimen/text_size_normal"
android:layout_marginLeft="10dp"
/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<!--<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey_background">
<Button
android:id="@+id/btnsubmit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:padding="5dp"
android:text="Submit"
android:background="@color/colorPrimary"
android:textColor="@color/white"
android:textSize="@dimen/text_size_normal"
/>
</RelativeLayout>-->
</LinearLayout>
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true" />
<TextView
android:id="@+id/percentage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/progressBar1"
android:layout_marginTop="10dp"/>
<TextView
android:id="@+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/progressBar1"
android:layout_marginTop="10dp"
android:layout_centerHorizontal="true" />
</RelativeLayout>
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/nav_header"
android:layout_width="match_parent"
android:layout_height="@dimen/nav_header_height"
android:background="@drawable/side_nav_bar"
android:gravity="bottom"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="5dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<!-- <ImageView
android:layout_width="match_parent"
android:layout_height="35dp"
android:background="@drawable/rtretail"
android:visibility="gone"/>-->
<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginTop="5dp"
android:src="@drawable/gsk_logo" />
<TextView
android:id="@+id/nav_user_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Android Studio"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
<TextView
android:id="@+id/nav_user_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="android.studio@android.com"
android:visibility="gone"/>
</LinearLayout>
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_route_plan"
android:icon="@drawable/ic_menu_gallery"
android:title="@string/menu_daily_route_plan" />
<item
android:id="@+id/nav_download"
android:icon="@drawable/ic_menu_slideshow"
android:title="@string/menu_daily_download" />
<item
android:id="@+id/nav_upload"
android:icon="@drawable/ic_menu_send"
android:title="@string/menu_upload_data" />
<item
android:id="@+id/nav_geotag"
android:icon="@drawable/ic_menu_manage"
android:title="@string/menu_geotag" />
<item
android:id="@+id/nav_exit"
android:icon="@drawable/ic_menu_send"
android:title="@string/menu_exit" />
</group>
<item android:title="">
<menu>
<item
android:id="@+id/nav_setting"
android:icon="@drawable/ic_menu_manage"
android:title="@string/menu_setting" />
<item
android:id="@+id/nav_services"
android:icon="@drawable/ic_menu_send"
android:title="@string/menu_services" />
</menu>
</item>
</menu>
+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<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: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="prompt_email">البريد الإلكتروني</string>
<string name="prompt_password">كلمة السر (اختياري)</string>
<string name="action_sign_in">تسجيل الدخول أو التسجيل</string>
<string name="action_sign_in_short">تسجيل الدخول</string>
<string name="error_invalid_email">عنوان البريد الإلكتروني هذا غير صالح</string>
<string name="error_invalid_password">هذه كلمة المرور قصيرة جدا</string>
<string name="error_incorrect_password">هذه كلمة المرور غير صحيحة</string>
<string name="error_field_required">هذه الخانة مطلوبه</string>
<string name="permission_rationale">"هناك حاجة إلى صلات الأذونات لتوفير البريد الإلكتروني
        الاكمال."
</string>
</resources>
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="prompt_email">E-posta</string>
<string name="prompt_password">Şifre (isteğe bağlı)</string>
<string name="action_sign_in">Giriş yapın veya kayıt olun</string>
<string name="action_sign_in_short">oturum aç</string>
<string name="error_invalid_email">Bu e-posta adresi geçersiz</string>
<string name="error_invalid_password">Bu şifre çok kısa</string>
<string name="error_incorrect_password">Bu şifre yanlış</string>
<string name="error_field_required">Bu alan gereklidir</string>
<string name="permission_rationale">"E-posta sağlamak için kişiler izinleri gereklidir
Tamamlamalar."
</string>
</resources>
@@ -0,0 +1,9 @@
<resources>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>
@@ -0,0 +1,6 @@
<resources>
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
<dimen name="activity_horizontal_margin">64dp</dimen>
</resources>
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#FF9800</color>
<color name="colorPrimaryDark">#F57C00</color>
<color name="colorAccent">#2196F3</color>
<color name="white">#FFFFFF</color>
<color name="black">#000000</color>
<color name="grey_background">#EEEEEE</color>
<color name="blue">#2196F3</color>
</resources>
@@ -0,0 +1,15 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="nav_header_vertical_spacing">16dp</dimen>
<dimen name="nav_header_height">160dp</dimen>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="custom_margin">5dp</dimen>
<dimen name="text_size_normal">20sp</dimen>
<dimen name="text_size_small">16sp</dimen>
</resources>
@@ -0,0 +1,8 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<item name="ic_menu_camera" type="drawable">@android:drawable/ic_menu_camera</item>
<item name="ic_menu_gallery" type="drawable">@android:drawable/ic_menu_gallery</item>
<item name="ic_menu_slideshow" type="drawable">@android:drawable/ic_menu_slideshow</item>
<item name="ic_menu_manage" type="drawable">@android:drawable/ic_menu_manage</item>
<item name="ic_menu_share" type="drawable">@android:drawable/ic_menu_share</item>
<item name="ic_menu_send" type="drawable">@android:drawable/ic_menu_send</item>
</resources>
@@ -0,0 +1,35 @@
<resources>
<string name="app_name">GSKMTOrange</string>
<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string>
<string name="action_settings">Settings</string>
<string name="title_activity_login">Sign in</string>
<!-- Strings related to login -->
<string name="prompt_email">E Mail</string>
<string name="prompt_userid">User Id</string>
<string name="prompt_password">Password</string>
<string name="action_sign_in">Login</string>
<string name="action_sign_in_short">Sign in</string>
<string name="error_invalid_email">This email address is invalid</string>
<string name="error_invalid_password">This password is too short</string>
<string name="error_incorrect_password">This password is incorrect</string>
<string name="error_field_required">This field is required</string>
<string name="permission_rationale">"Contacts permissions are needed for providing email
completions."
</string>
<string name="select_language">Please select language</string>
<string name="title_activity_select_language">SelectLanguageActivity</string>
<string name="menu_daily_route_plan">Daily Route Plan</string>
<string name="menu_daily_download">Daily Data Download</string>
<string name="menu_upload_data">Upload Data</string>
<string name="menu_geotag">Geo Tag</string>
<string name="menu_exit">Exit</string>
<string name="menu_setting">Setting</string>
<string name="menu_services">Services</string>
</resources>
@@ -0,0 +1,20 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>