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
+9
View File
@@ -0,0 +1,9 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
+24
View File
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="BUILD_PROCESS_HEAP_SIZE" value="1024" />
<option name="BUILD_PROCESS_ADDITIONAL_VM_OPTIONS" value="-Xmx512m" />
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>
+3
View File
@@ -0,0 +1,3 @@
<component name="CopyrightManager">
<settings default="" />
</component>
+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/GSKMTOrange" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>
+66
View File
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidDexCompilerConfiguration">
<option name="VM_OPTIONS" value="-Xmx512m" />
<option name="MAX_HEAP_SIZE" value="1024" />
</component>
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<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">
<option name="id" value="Android" />
</component>
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/GSKMTOrange/GSKMTOrange.iml" filepath="$PROJECT_DIR$/GSKMTOrange/GSKMTOrange.iml" />
<module fileurl="file://$PROJECT_DIR$/GSKMTOrange2.iml" filepath="$PROJECT_DIR$/GSKMTOrange2.iml" />
</modules>
</component>
</project>
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
Generated
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
+1
View File
@@ -0,0 +1 @@
/build
+38
View File
@@ -0,0 +1,38 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "cpm.com.gskmtorange"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/ksoap2-android-assembly-3.6.2-jar-with-dependencies.jar')
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.android.support:cardview-v7:24.2.1'
}
+17
View File
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in E:\adt-bundle-windows-x86_64-20140702\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
@@ -0,0 +1,26 @@
package cpm.com.gskmtorange;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("cpm.com.gskmtorange", appContext.getPackageName());
}
}
+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>
@@ -0,0 +1,17 @@
package cpm.com.gskmtorange;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
+23
View File
@@ -0,0 +1,23 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
+17
View File
@@ -0,0 +1,17 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
Binary file not shown.
+6
View File
@@ -0,0 +1,6 @@
#Mon Dec 28 10:00:20 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
Vendored
+160
View File
@@ -0,0 +1,160 @@
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
Vendored
+90
View File
@@ -0,0 +1,90 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
+1
View File
@@ -0,0 +1 @@
include ':GSKMTOrange'