upto live agent

parent 120ff51d
Showing with 1065 additions and 143 deletions
......@@ -98,12 +98,15 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-annotations:27.1.1'
implementation 'android.arch.lifecycle:extensions:1.1.1'
testImplementation 'junit:junit:4.12'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation ('com.google.android.gms:play-services-analytics:16.0.8') {
implementation('com.google.android.gms:play-services-analytics:16.0.8') {
exclude group: 'com.google.firebase', module: 'firebase-iid'
}
......@@ -120,7 +123,7 @@ dependencies {
implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation 'com.android.support:support-media-compat:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation ('com.google.firebase:firebase-messaging:17.6.0') {
implementation('com.google.firebase:firebase-messaging:17.6.0') {
exclude group: 'com.google.firebase', module: 'firebase-iid'
}
implementation 'com.google.firebase:firebase-core:16.0.9'
......@@ -130,7 +133,7 @@ dependencies {
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'com.quickbirdstudios:opencv:4.1.0'
implementation 'org.jsoup:jsoup:1.11.3'
//static Reports Screen
implementation 'com.numetriclabz.numandroidcharts:numandroidcharts:1.0.9'
implementation 'info.hoang8f:android-segmented:1.0.6'
......
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.vsoft.vera">
......@@ -14,57 +15,63 @@
<uses-permission android:name="android.permission.CAMERA" />
<application
android:name="com.vsoft.vera.CatalogueApplication"
android:name=".CatalogueApplication"
android:allowBackup="false"
android:fullBackupContent="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:usesCleartextTraffic="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
tools:replace="allowBackup">
<activity
android:name="com.vsoft.vera.ui.SplashScreen"
android:name=".ui.SplashScreen"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize|stateHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.vsoft.vera.ui.LoginScreen"
android:name=".ui.LoginScreen"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize|stateHidden" />
<activity android:name=".ui.ResetPasswordActivity"
android:screenOrientation="portrait"
android:fitsSystemWindows="true"
android:windowSoftInputMode="stateAlwaysHidden|adjustResize"/>
<activity
android:name="com.vsoft.vera.ui.HomeScreen"
android:name=".ui.HomeScreen"
android:screenOrientation="portrait" />
<activity
android:name="com.vsoft.vera.ui.CatalogueScreen"
android:name=".ui.CatalogueScreen"
android:screenOrientation="portrait" />
<activity
android:name="com.vsoft.vera.ui.CatalogueItemScreen"
android:name=".ui.CatalogueItemScreen"
android:screenOrientation="portrait" />
<activity
android:name="com.vsoft.vera.CatalogueWebViewScreen"
android:name=".CatalogueWebViewScreen"
android:screenOrientation="portrait" />
<activity
android:name="com.vsoft.vera.ui.CatalogueVariableScreen"
android:name=".ui.CatalogueVariableScreen"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustResize" />
<activity
android:name="com.vsoft.vera.ui.ReportIncidentScreen"
android:name=".ui.ReportIncidentScreen"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustResize" />
<activity
android:name="com.vsoft.vera.ui.MyRequestActivity"
android:name=".ui.MyRequestActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.vsoft.vera.ui.MyIncidentScreen"
android:name=".ui.MyIncidentScreen"
android:screenOrientation="portrait" />
<activity android:name=".ui.InAppWebViewActivity"/>
<activity android:name=".ui.InAppWebViewActivity" />
<service android:name=".service.SyncService" />
......@@ -82,4 +89,5 @@
android:name="io.fabric.ApiKey"
android:value="2b0a6e9db28d607fbcf71b8b25f1a0795e3f5b22" />
</application>
</manifest>
\ No newline at end of file
......@@ -27,9 +27,55 @@ public class RestClient {
// set your desired log level
logging.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient.Builder httpClient = new OkHttpClient.Builder()
.connectTimeout(10, TimeUnit.SECONDS)
.writeTimeout(10, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS);
.connectTimeout(600, TimeUnit.SECONDS)
.writeTimeout(600, TimeUnit.SECONDS)
.readTimeout(600, TimeUnit.SECONDS);
// add your other interceptors
Interceptor interceptor = new Interceptor() {
@Override
public Response intercept(Chain chain) {
Request original = chain.request();
Request.Builder requestBuilder = original.newBuilder();
if(!TextUtils.isEmpty(accessToken)) {
final String bearer = "Bearer " + accessToken;
requestBuilder.header(Constants.API_HEADER_PARAM_AUTHORIZATION, bearer);
}
requestBuilder.header("Accept", "application/json");
requestBuilder.header("Content-Type", "application/json");
requestBuilder.method(original.method(), original.body());
Request request = requestBuilder.build();
try {
return chain.proceed(request);
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
};
httpClient.interceptors().add(interceptor);
// add logging as last interceptor
httpClient.interceptors().add(logging); // <-- this is the important line!
Retrofit.Builder builder = new Retrofit.Builder()
.baseUrl(Constants.DOMAIN)
.client(httpClient.build())
.addConverterFactory(new GsonStringConverterFactory())
.addConverterFactory(GsonConverterFactory.create());
return builder.build();
}
public static Retrofit getInitializedRestAdapterRestPWD(final String accessToken) {
HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
// set your desired log level
logging.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient.Builder httpClient = new OkHttpClient.Builder()
.connectTimeout(600, TimeUnit.SECONDS)
.writeTimeout(600, TimeUnit.SECONDS)
.readTimeout(600, TimeUnit.SECONDS);
// add your other interceptors
Interceptor interceptor = new Interceptor() {
@Override
......@@ -74,9 +120,9 @@ public class RestClient {
// set your desired log level
logging.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient.Builder httpClient = new OkHttpClient.Builder()
.connectTimeout(10, TimeUnit.SECONDS)
.writeTimeout(10, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS);
.connectTimeout(600, TimeUnit.SECONDS)
.writeTimeout(600, TimeUnit.SECONDS)
.readTimeout(600, TimeUnit.SECONDS);
// add your other interceptors
Interceptor interceptor = new Interceptor() {
@Override
......
package com.vsoft.vera.api.interfaces;
import com.vsoft.vera.api.pojos.ChatHistoryPostData;
import com.vsoft.vera.api.pojos.LiveAgentResultData;
import com.vsoft.vera.api.pojos.LoginApiResponse;
import com.vsoft.vera.utils.Constants;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Query;
......@@ -38,6 +42,13 @@ public interface LoginApi {
@PUT(Constants.URL_PUT_LOGOUT)
Call<ResponseBody> logout(@Query(LoginApiResponse.Json.JSON_SYS_ID) String userSysId);
@POST(Constants.LIVE_AGENT_API)
Call<LiveAgentResultData> postChatHistory(@Query(Constants.USER_ID) String userID,
@Query(Constants.MESSAGE) String message,
@Body ChatHistoryPostData chatData);
}
package com.vsoft.vera.api.interfaces;
import com.vsoft.vera.api.pojos.LoginApiResponse;
import com.vsoft.vera.utils.Constants;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.PUT;
import retrofit2.http.Path;
......@@ -25,6 +28,14 @@ public interface UserApi {
@PUT(Constants.URL_PUT_DEVICE_REGISTRATION)
Call<ResponseBody> putDeviceRegistration(@Path("user_sys_id") String userSysId, @Body String body);
}
@PUT(Constants.URL_PUT_DEVICE_REGISTRATION)
Call<ResponseBody> putDeviceRegistration( @Body String body);
@PUT(Constants.URL_PUT_PASSWORD_RESET)
Call<ResponseBody> putResetPassword(@Body String body);
}
package com.vsoft.vera.api.listeners.get;
import com.vsoft.vera.api.pojos.LoginApiResponse;
/**
* @since 1.0
* @author Kunj on 11/8/16
*
*/
public interface GetLiveAgentApiListener {
void onDoneApiCall(String resultUrl);
void onFailApiCall();
}
......@@ -6,7 +6,7 @@ import java.util.List;
/**
* @since 1.0
* @author Kunj on 11/8/16
* @author krishna on 11/8/16
*
*/
public interface GetUserDetailApiListener {
......
......@@ -4,7 +4,7 @@ import com.vsoft.vera.api.pojos.LoginApiResponse;
/**
* @since 1.0
* @author Kunj on 11/8/16
* @author krishna on 11/8/16
*
*/
public interface PutDeviceRegistrationApiListener {
......
package com.vsoft.vera.api.listeners.put;
/**
* @since 1.0
* @author krishna on 11/8/16
*
*/
public interface PutRestPasswordApiListener {
void onDoneApiCall();
void onFailApiCall();
}
......@@ -13,8 +13,10 @@ import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import com.vsoft.vera.api.RestClient;
import com.vsoft.vera.api.interfaces.LoginApi;
import com.vsoft.vera.api.listeners.get.GetLiveAgentApiListener;
import com.vsoft.vera.api.listeners.get.GetUserLoginApiListener;
import com.vsoft.vera.api.listeners.put.PutLogoutApiListener;
import com.vsoft.vera.api.listeners.put.PutRestPasswordApiListener;
import com.vsoft.vera.api.pojos.LoginApiResponse;
import com.vsoft.vera.utils.Constants;
import com.vsoft.vera.enums.SyncStatus;
......@@ -186,4 +188,8 @@ public class LoginApiManager {
listener.onFailApiCall();
}
}
}
package com.vsoft.vera.api.managers;
import android.content.Context;
import android.util.Log;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
......@@ -8,11 +9,19 @@ import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import com.vsoft.vera.api.interfaces.LoginApi;
import com.vsoft.vera.api.interfaces.UserApi;
import com.vsoft.vera.api.listeners.get.GetLiveAgentApiListener;
import com.vsoft.vera.api.listeners.get.GetUserDetailApiListener;
import com.vsoft.vera.api.RestClient;
import com.vsoft.vera.api.listeners.put.PutDeviceRegistrationApiListener;
import com.vsoft.vera.api.listeners.put.PutRestPasswordApiListener;
import com.vsoft.vera.api.pojos.ChatHistoryPostData;
import com.vsoft.vera.api.pojos.LiveAgentResultData;
import com.vsoft.vera.api.pojos.LoginApiResponse;
import com.vsoft.vera.db.models.UserApiValues;
import com.vsoft.vera.enums.SyncStatus;
import com.vsoft.vera.ui.CatalogueVariableScreen;
import com.vsoft.vera.ui.LoginScreen;
import com.vsoft.vera.utils.CatalogueLog;
import com.vsoft.vera.utils.Constants;
......@@ -158,4 +167,100 @@ public class UserApiManager {
}
}
public static void putResetPassord(Context context, String password, PutRestPasswordApiListener listener) {
String accessToken = PrefManager.getSharedPref(context, PrefManager.PREFERENCE_ACCESS_TOKEN);
String userId = PrefManager.getSharedPref(context, PrefManager.PREFERENCE_USER_ID);
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put(Constants.PASSWORD, password);
jsonObject.put(Constants.USER_ID, userId);
} catch(JSONException e) {
CatalogueLog.e("putDeviceRegistration: JSONException: " + e.toString());
}
final Retrofit retrofit = RestClient.getInitializedRestAdapterRestPWD(accessToken);
Call<ResponseBody> call = retrofit.create(UserApi.class).putResetPassword(jsonObject.toString());
try {
//Retrofit synchronous call
Response<ResponseBody> response = call.execute();
if (response.isSuccessful()) {
listener.onDoneApiCall();
} else {
CatalogueLog.d("LoginApiManager: logout: response is not success");
if (response.code() == 401) {
Log.d(Constants.TAG, "-- is 401, try refresh token...");
Log.d(Constants.TAG, "refresh token: " + PrefManager.getSharedPref(context, PrefManager.PREFERENCE_REFRESH_TOKEN));
SyncStatus status = LoginApiManager.refreshLogin(context, PrefManager.getSharedPref(context, PrefManager.PREFERENCE_REFRESH_TOKEN));
if (status == SyncStatus.SUCCESS) {
CatalogueLog.d("refresh token success, retry same...");
} else {
CatalogueLog.d("refresh token failed, return FAIL");
}
} else {
listener.onFailApiCall();
}
}
} catch (IOException e) {
CatalogueLog.e("LoginApiManager: submitLoginValues: IOException: ", e);
listener.onFailApiCall();
} catch (NullPointerException e) {
CatalogueLog.e("LoginApiManager: submitLoginValues: IOException: ", e);
listener.onFailApiCall();
}
}
public static void submitChatHistory(Context context,String accToken,String userId, String Messge, ChatHistoryPostData chatHistoryPostData, final GetLiveAgentApiListener listener) {
if(accToken !=null){
String accessToken = PrefManager.getSharedPref(context, PrefManager.PREFERENCE_ACCESS_TOKEN);
final Retrofit retrofit = RestClient.getInitializedRestAdapterRestPWD(accToken);
Call<LiveAgentResultData> call = retrofit.create(LoginApi.class).postChatHistory(userId,Messge,chatHistoryPostData);
try {
Response<LiveAgentResultData> response = call.execute();
if (response.isSuccessful()) {
listener.onDoneApiCall(response.body().getResult());
} else {
CatalogueLog.d("LoginApiManager: logout: response is not success");
if (response.code() == 401) {
Log.d(Constants.TAG, "-- is 401, try refresh token...");
Log.d(Constants.TAG, "refresh token: " + PrefManager.getSharedPref(context, PrefManager.PREFERENCE_REFRESH_TOKEN));
SyncStatus status = LoginApiManager.refreshLogin(context, PrefManager.getSharedPref(context, PrefManager.PREFERENCE_REFRESH_TOKEN));
if (status == SyncStatus.SUCCESS) {
CatalogueLog.d("refresh token success, retry same...");
String acc = PrefManager.getSharedPref(context, PrefManager.PREFERENCE_ACCESS_TOKEN);
submitChatHistory(context,acc,userId,Messge,chatHistoryPostData,listener);
} else {
CatalogueLog.d("refresh token failed, return FAIL");
}
} else {
listener.onFailApiCall();
}
}
} catch (IOException e) {
e.printStackTrace();
listener.onFailApiCall();
}
}else {
SyncStatus status = LoginApiManager.refreshLogin(context, PrefManager.getSharedPref(context, PrefManager.PREFERENCE_REFRESH_TOKEN));
if (status == SyncStatus.SUCCESS) {
String acc = PrefManager.getSharedPref(context, PrefManager.PREFERENCE_ACCESS_TOKEN);
submitChatHistory(context,acc,userId,Messge,chatHistoryPostData,listener);
CatalogueLog.d("refresh token success, retry same...");
} else {
CatalogueLog.d("refresh token failed, return FAIL");
}
}
}
}
package com.vsoft.vera.api.pojos;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* Created by kvemulavada on 16-11-2017.
*/
public class ChatHistoryPostData {
@SerializedName("attachment_name")
@Expose
private String attachmentName;
@SerializedName("attachment_type")
@Expose
private String attachmentType;
@SerializedName("attachment_data")
@Expose
private String attachmentData;
public String getAttachmentName() {
return attachmentName;
}
public void setAttachmentName(String attachmentName) {
this.attachmentName = attachmentName;
}
public String getAttachmentType() {
return attachmentType;
}
public void setAttachmentType(String attachmentType) {
this.attachmentType = attachmentType;
}
public String getAttachmentData() {
return attachmentData;
}
public void setAttachmentData(String attachmentData) {
this.attachmentData = attachmentData;
}
}
\ No newline at end of file
package com.vsoft.vera.api.pojos;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class LiveAgentResultData {
@SerializedName("result")
@Expose
private String result;
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
}
......@@ -71,8 +71,11 @@ public class LoginApiResponse {
public static final String USER_NAME = "username";
public static final String PASSWORD = "password";
public static final String REFRESH_TOKEN = "refresh_token";
public static final String USER_ID = "userID";
public static final String JSON_ACCESS_TOKEN = "access_token";
public static final String JSON_SYS_ID = "sys_id";
}
}
......@@ -11,11 +11,11 @@ import com.vsoft.vera.utils.Util;
/**
*
* @author Kunj on 11-08-2016.
* @author krishna on 11-08-2016.
*/
public class DBManager extends SQLiteOpenHelper implements DBConstants {
private static final String DATABASE_NAME = "uofl.db";
public static final String DATABASE_NAME = "uofl.db";
private static final int DATABASE_VERSION = 1;
private Context mContext;
......
......@@ -11,6 +11,8 @@ public class ChatBotHistory {
private long timestamp;
private String imagUrl;
private String userName;
private boolean hasButtonSelected;
private int selPosition;
public long getId() {
return id;
......@@ -27,6 +29,21 @@ public class ChatBotHistory {
this.imagUrl = imagUrl;
}
public boolean isHasButtonSelected() {
return hasButtonSelected;
}
public void setHasButtonSelected(boolean hasButtonSelected) {
this.hasButtonSelected = hasButtonSelected;
}
public int getSelPosition() {
return selPosition;
}
public void setSelPosition(int selPosition) {
this.selPosition = selPosition;
}
public long getUserId() {
return userId;
......@@ -93,6 +110,8 @@ public class ChatBotHistory {
return this;
}
public ChatBotBuilder setMessage(String val) {
message = val;
return this;
......
package com.vsoft.vera.ui;
import android.Manifest;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.Toolbar;
import android.widget.GridView;
......@@ -56,9 +61,20 @@ public class HomeScreen extends HandleNotificationActivity {
@OnItemClick(R.id.home_screen_grid_view)
void gridViewItemClicked(int position) {
int permission_camera = ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA);
int permissionResult_storage = ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
if( (permission_camera == PackageManager.PERMISSION_GRANTED) &&
(permissionResult_storage == PackageManager.PERMISSION_GRANTED)
){
HomeScreenMenuItemData homeScreenMenuItemData = MenuProvider.MENU_ITEMS.get(position);
Intent intent = new Intent(this, homeScreenMenuItemData.getActivity());
startActivity(intent);
}else{
checkPermissions();
}
}
@OnClick(R.id.nav_back)
......@@ -116,7 +132,29 @@ public class HomeScreen extends HandleNotificationActivity {
AlertDialog alert = builder.create();
alert.show();
}
/* checking the application Permissions */
private void checkPermissions() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (
checkSelfPermission(Manifest.permission.CAMERA) == PackageManager.PERMISSION_DENIED ||
checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_DENIED ||
checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_DENIED
// || checkSelfPermission(Manifest.permission.INTERNET) == PackageManager.PERMISSION_DENIED ||
// checkSelfPermission(Manifest.permission.ACCESS_NETWORK_STATE) == PackageManager.PERMISSION_DENIED
) {
String[] permissions = new String[]{
Manifest.permission.CAMERA,
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.INTERNET
};
requestPermissions(permissions, 100);
}
}
}
class LogoutTask extends AsyncTask<String, Void, SyncStatus> {
private ProgressDialog progressDialog;
private SyncStatus syncStatus = SyncStatus.FAIL;
......@@ -183,4 +221,48 @@ public class HomeScreen extends HandleNotificationActivity {
AlertDialog alert = builder.create();
alert.show();
}
private void checkCameraPermissionSettings() {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
int permission_camera = ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA);
int permissionResult_storage = ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
boolean camera = shouldShowRequestPermissionRationale(Manifest.permission.CAMERA);
boolean storage = shouldShowRequestPermissionRationale(Manifest.permission.WRITE_EXTERNAL_STORAGE);
boolean location = shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_FINE_LOCATION);
if( (permission_camera != PackageManager.PERMISSION_GRANTED) ||
(permissionResult_storage != PackageManager.PERMISSION_GRANTED)
){
Util.displayCameraPermisionSettingsPopup(this);
}
// if(!camera ||!storage|| !location ){
// AppUtils.displayCameraPermisionSettingsPopup(this);
// }
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == 100) {
int i = 0;
for (int grant : grantResults) {
if (grant == PackageManager.PERMISSION_DENIED) {
i++;
}
}
if(i==grantResults.length){
}else{
checkCameraPermissionSettings();
}
}
}
}
......@@ -7,9 +7,12 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.content.LocalBroadcastManager;
import android.text.TextUtils;
import android.text.method.HideReturnsTransformationMethod;
import android.text.method.PasswordTransformationMethod;
import android.view.KeyEvent;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import com.google.android.gms.analytics.Tracker;
import com.vsoft.vera.CatalogueApplication;
......@@ -44,6 +47,8 @@ public class LoginScreen extends Activity {
@BindView(R.id.login_screen_username_edit_text) EditText mUserNameEditText;
@BindView(R.id.login_screen_password_edit_text) EditText mPasswordEditText;
@BindView(R.id.password_show_iv) ImageView psswordShowIM;
@BindView(R.id.password_hide_iv) ImageView hidePasswordIM;
private List<UserApiValues> mUserDetails;
private CatalogueApplication mApplication;
......@@ -57,13 +62,15 @@ public class LoginScreen extends Activity {
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
setContentView(R.layout.activity_login_view);
ButterKnife.bind(this);
mApplication = (CatalogueApplication) getApplication();
CheckLoginValues();
mPasswordEditText.setOnKeyListener(new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
......@@ -80,6 +87,27 @@ public class LoginScreen extends Activity {
}
});
psswordShowIM.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
hidePasswordIM.setVisibility(View.VISIBLE);
psswordShowIM.setVisibility(View.GONE);
mPasswordEditText.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
int textLength = mPasswordEditText.getText().length();
mPasswordEditText.setSelection(textLength, textLength);
}
});
hidePasswordIM.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
psswordShowIM.setVisibility(View.VISIBLE);
hidePasswordIM.setVisibility(View.GONE);
mPasswordEditText.setTransformationMethod(PasswordTransformationMethod.getInstance());
int textLength = mPasswordEditText.getText().length();
mPasswordEditText.setSelection(textLength, textLength);
}
});
CatalogueApplication application = (CatalogueApplication) getApplication();
Tracker tracker = application.getDefaultTracker();
Util.sendScreenName(tracker, getString(R.string.login_screen_string));
......@@ -131,6 +159,7 @@ public class LoginScreen extends Activity {
@OnClick(R.id.login_screen_login_text_view)
void onLoginClicked() {
callLoginAPI();
}
private class LoginDetailsSendToServer extends AsyncTask<String, Integer, Integer> {
......@@ -213,6 +242,16 @@ public class LoginScreen extends Activity {
}
if (syncStatus == API_SUCCESS_USER_DETAIL) {
if (mUserDetails != null) {
if (((CatalogueApplication) getApplication()).isNetConnected()) {
ChatBotHistoryManager.delete();
String generateRandomStrPharma = GenerateRandomString.randomString(30);
PrefManager.setSharedPref(LoginScreen.this, PrefManager.SESSION_ID, generateRandomStrPharma);
} else {
DialogUtils.showNoConnectionDialog(LoginScreen.this);
}
String generateRandoStrPharma = GenerateRandomString.randomString(30);
PrefManager.setSharedPref(LoginScreen.this, PrefManager.SESSION_ID, generateRandoStrPharma);
String firstName = mUserDetails.get(0).getFirstName();
......@@ -253,6 +292,7 @@ public class LoginScreen extends Activity {
PrefManager.setSharedPref(LoginScreen.this, PrefManager.PREFERENCE_USER_ID, userId);
PrefManager.setSharedPref(LoginScreen.this, PrefManager.PREFERENCE_USER_EMAIL_ID, userEmailId);
/*Send broadcast to start SyncService*/
Intent intent = new Intent(Constants.APPLICATION_BROADCAST_INTENT);
intent.putExtra(Constants.APPLICATION_BROADCAST_DATA_ACTION, Constants.ACTION_SYNC);
......
package com.vsoft.vera.ui.data;
import com.vsoft.vera.ui.data.model.LoggedInUser;
import java.io.IOException;
/**
* Class that handles authentication w/ login credentials and retrieves user information.
*/
public class LoginDataSource {
public Result<LoggedInUser> login(String username, String password) {
try {
// TODO: handle loggedInUser authentication
LoggedInUser fakeUser =
new LoggedInUser(
java.util.UUID.randomUUID().toString(),
"Jane Doe");
return new Result.Success<>(fakeUser);
} catch (Exception e) {
return new Result.Error(new IOException("Error logging in", e));
}
}
public void logout() {
// TODO: revoke authentication
}
}
package com.vsoft.vera.ui.data;
import com.vsoft.vera.ui.data.model.LoggedInUser;
/**
* Class that requests authentication and user information from the remote data source and
* maintains an in-memory cache of login status and user credentials information.
*/
public class LoginRepository {
private static volatile LoginRepository instance;
private LoginDataSource dataSource;
// If user credentials will be cached in local storage, it is recommended it be encrypted
// @see https://developer.android.com/training/articles/keystore
private LoggedInUser user = null;
// private constructor : singleton access
private LoginRepository(LoginDataSource dataSource) {
this.dataSource = dataSource;
}
public static LoginRepository getInstance(LoginDataSource dataSource) {
if (instance == null) {
instance = new LoginRepository(dataSource);
}
return instance;
}
public boolean isLoggedIn() {
return user != null;
}
public void logout() {
user = null;
dataSource.logout();
}
private void setLoggedInUser(LoggedInUser user) {
this.user = user;
// If user credentials will be cached in local storage, it is recommended it be encrypted
// @see https://developer.android.com/training/articles/keystore
}
public Result<LoggedInUser> login(String username, String password) {
// handle login
Result<LoggedInUser> result = dataSource.login(username, password);
if (result instanceof Result.Success) {
setLoggedInUser(((Result.Success<LoggedInUser>) result).getData());
}
return result;
}
}
package com.vsoft.vera.ui.data;
/**
* A generic class that holds a result success w/ data or an error exception.
*/
public class Result<T> {
// hide the private constructor to limit subclass types (Success, Error)
private Result() {
}
@Override
public String toString() {
if (this instanceof Result.Success) {
Result.Success success = (Result.Success) this;
return "Success[data=" + success.getData().toString() + "]";
} else if (this instanceof Result.Error) {
Result.Error error = (Result.Error) this;
return "Error[exception=" + error.getError().toString() + "]";
}
return "";
}
// Success sub-class
public final static class Success<T> extends Result {
private T data;
public Success(T data) {
this.data = data;
}
public T getData() {
return this.data;
}
}
// Error sub-class
public final static class Error extends Result {
private Exception error;
public Error(Exception error) {
this.error = error;
}
public Exception getError() {
return this.error;
}
}
}
package com.vsoft.vera.ui.data.model;
/**
* Data class that captures user information for logged in users retrieved from LoginRepository
*/
public class LoggedInUser {
private String userId;
private String displayName;
public LoggedInUser(String userId, String displayName) {
this.userId = userId;
this.displayName = displayName;
}
public String getUserId() {
return userId;
}
public String getDisplayName() {
return displayName;
}
}
......@@ -23,6 +23,7 @@ public class Constants {
* Intent String
*/
public static final String DATA_DATE_AND_TIME_PICKER_TITLE = "title";
public static final String RESET_PASSWORD_NAVIGATION_SCREEN = "GoForResetPasswordScreen";
public static final String DATA_KEY_SYS_ID = "sys_id";
public static final String DATA_KEY_REFERENCE_TABLE_NAME = "table_name";
public static final String DATA_KEY_REFERENCE_TABLE_COLUMN_NAME = "table_column_name";
......@@ -45,6 +46,12 @@ public class Constants {
public static final String ACTION_SYNC = "action_sync";
public static final String BROADCAST_NOTIFICATION = "broadcast_notification";
public static final String PASSWORD = "password";
public static final String USER_ID = "userID";
public static final String MESSAGE = "Message";
/**
* Broadcast custom intent
*/
......@@ -52,6 +59,11 @@ public class Constants {
public static final String APPLICATION_BROADCAST_DATA_ACTION = "action";
public static final String ACTION_PROMPT_LOGIN = "action_prompt_login";
public static final String ATTACHMENT_NAME = "attachment_name";
public static final String ATTACHMENT_TYPE = "attachment_type";
public static final String ATTACHMENT_DATA = "attachment_data";
/**
* Catalogue services post parameters
*/
......@@ -153,6 +165,8 @@ public class Constants {
public static final String URL_PUT_DEVICE_REGISTRATION = "api/now/table/sys_user/{user_sys_id}";
public static final String URL_GET_USERDETAILS = API_PATH + "sys_user";
public static final String URL_PUT_LOGOUT = "/api/x_vsng2_chatbot/uofl_mobile/logout";
public static final String URL_PUT_PASSWORD_RESET = "/api/vsng2/chatbot_api_services/passwordrest";
public static final String LIVE_AGENT_API = "api/x_vsng2_chatbot/chatbot/chatapi";
/*Catalogue Category API */
public static final String URL_GET_CATALOGUE = DOMAIN + AppConfig.URL_GET_CATALOGUE;
......@@ -160,7 +174,8 @@ public class Constants {
/*Catalogue Category Items API */
public static final String URL_GET_CATALOGUE_ITEM = DOMAIN + AppConfig.URL_GET_CATALOGUE_ITEM;
public static final String BEARER = "Basic ";
public static final String CONTENT_TYPE = "application/json";
/*Variable form API */
public static final String URL_GET_VARIABLE = AppConfig.URL_GET_VARIABLE;
public static final String URL_GET_UI_POLICY = AppConfig.URL_GET_UI_POLICY;
......@@ -210,4 +225,10 @@ public class Constants {
* Chat Server URL
* */
public static String CHAT_SERVER_URL;
public static final String HTML_HREF_TEXT = "href";
public static final String HTML_BR_TAG_TEXT = "<br>";
public static final String HTML_BTN_TAG_TEXT = "<button onclick=";
public static final String HTML_PARA_TAG_TEXT = "<p attr=\"horizontal";
public static final String HTML_PARA_TAG_TEXT_EXT = "<p attr=\\\"horizontal";
}
......@@ -14,14 +14,15 @@ public class PrefManager {
public static final String PREFERENCE_USER_FULL_NAME = "full_name";
public static final String PREFERENCE_USER_ID = "user_id";
public static final String PREFERENCE_USER_EMAIL_ID = "user_email_id";
public static final String SESSION_ID = "pharma_session_id";
public static final String SESSION_ID = "session_id";
//Chat Server Url
public static final String PREFERENCE_CHAT_SERVER_URL = "chat_server_url";
/*Access Token */
public static final String PREFERENCE_ACCESS_TOKEN = "access_token";
public static final String PREFERENCE_REFRESH_TOKEN = "refresh_token";
public static final String PREFERENCE_CHAT_ITEM_POSITION = "chat_position";
public static final String PREFERENCE_CHAT_BUTTON_POSITION = "chat_button_position";
private static final String SHARED_PREFERENCE_NAME = PrefManager.class.getSimpleName();
public static void setSharedPref(Context context, String key, String data) {
......
......@@ -2,6 +2,7 @@ package com.vsoft.vera.utils;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Typeface;
import android.media.AudioManager;
......@@ -9,6 +10,7 @@ import android.media.MediaPlayer;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
import android.provider.Settings;
import android.support.v4.content.ContextCompat;
import android.support.v4.content.FileProvider;
import android.support.v7.app.AlertDialog;
......@@ -1135,4 +1137,32 @@ public class Util {
}
return false;
}
public static void displayCameraPermisionSettingsPopup(final Context context) {
String message2 = "Please enable all permissions in Settings/Apps/VEERA/Permissions/ in order to use the Application.";
new android.app.AlertDialog.Builder(context)
.setTitle("Permissions Needed")
.setMessage(message2)
.setCancelable(false)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
try {
dialog.dismiss();
Intent intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
intent.setData(uri);
context.startActivity(intent);
} catch (Exception e) {
e.printStackTrace();
}
}
})
// .setNegativeButton(android.R.string.no, null)
.show();
}
}
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<gradient android:startColor="#94c2ED" android:endColor="#cbcbcb" android:angle="90" />
<corners android:topLeftRadius="25px" android:topRightRadius="0px" android:bottomLeftRadius="25px" android:bottomRightRadius="0px" />
</shape>
</item>
<item>
<shape>
<gradient android:startColor="#BDC3C7" android:endColor="#BDC3C7" android:angle="270" />
<corners android:topLeftRadius="0px" android:topRightRadius="0px" android:bottomLeftRadius="25px" android:bottomRightRadius="25px" />
</shape>
</item>
</selector>
\ No newline at end of file
<vector android:height="30dp" android:viewportHeight="24.0"
android:viewportWidth="24.0" android:width="30dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFFFF" android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
</vector>
<selector xmlns:android="http://schemas.android.com/apk/res/android"
android:exitFadeDuration="@android:integer/config_mediumAnimTime">
<item android:state_pressed="false">
<layer-list>
<!-- SHADOW -->
<!--<item>
<shape>
<solid android:color="#BCBABA"/>
<corners android:radius="19dp"/>
</shape>
</item>-->
<!-- BUTTON -->
<item android:bottom="5px">
<shape>
<gradient
android:startColor="@android:color/white"
android:endColor="@android:color/white"
android:angle="270" />
<corners android:radius="5dp"/>
<stroke android:width="5px"
android:color="#00576c" />
</shape>
</item>
</layer-list>
</item>
<item android:state_pressed="true">
<layer-list>
<!-- SHADOW -->
<!--<item>
<shape>
<solid android:color="@color/light_gray"/>
<corners android:radius="19dp"/>
</shape>
</item>-->
<!-- BUTTON -->
<item android:bottom="5px">
<shape android:textColor="@android:color/white">
<padding android:bottom="5dp"/>
<gradient
android:startColor="#287b00"
android:endColor="#287b00"
android:angle="270" />
<corners android:radius="5dp"/>
</shape>
</item>
</layer-list>
</item>
<item android:drawable="@drawable/chat_button_list_item_bg_with_border"/>
</selector>
\ No newline at end of file
<selector xmlns:android="http://schemas.android.com/apk/res/android"
android:exitFadeDuration="@android:integer/config_mediumAnimTime">
<item>
<layer-list>
<!-- SHADOW -->
<!--<item>
<shape>
<solid android:color="@color/light_gray"/>
<corners android:radius="19dp"/>
</shape>
</item>-->
<!-- BUTTON -->
<item android:bottom="5px">
<shape>
<padding android:bottom="5dp"/>
<gradient
android:startColor="#287b00"
android:endColor="#287b00"
android:angle="270" />
<corners android:radius="5dp"/>
</shape>
</item>
</layer-list>
</item>
</selector>
\ No newline at end of file
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:radius="5dp" />
<stroke
android:width="1dp"
android:color="@color/bg_border_color" />
</shape>
\ No newline at end of file
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle" >
<solid android:color="@android:color/transparent" />
</shape>
</item>
<item >
<shape>
<solid android:color="#fff"/>
<stroke
android:width="1dp"
android:color="#18455E" >
</stroke>
<corners
android:bottomRightRadius="10dp"
android:topRightRadius="10dp"
android:topLeftRadius="10dp"
/>
</shape>
</item>
<!-- <item android:state_pressed="true">
<shape>
</shape>
</item>
<item>
<shape>
<corners android:topLeftRadius="25px" android:topRightRadius="5px" android:bottomLeftRadius="25px" android:bottomRightRadius="25px" />
</shape>
</item>-->
</layer-list>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM12,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM12,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z"/>
</vector>
<vector android:height="24dp" android:tint="#BB0808"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM12,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z"/>
</vector>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle" >
<solid android:color="@android:color/transparent" />
</shape>
</item>
<item >
<shape>
<solid android:color="#DFDFDF"/>
<stroke
android:width="1dp"
android:color="#18455E" >
</stroke>
<corners
android:bottomRightRadius="0dp"
android:topRightRadius="10dp"
android:topLeftRadius="10dp"
android:bottomLeftRadius="10dp"
/>
</shape>
</item>
<!-- <item android:state_pressed="true">
<shape>
</shape>
</item>
<item>
<shape>
<corners android:topLeftRadius="25px" android:topRightRadius="5px" android:bottomLeftRadius="25px" android:bottomRightRadius="25px" />
</shape>
</item>-->
</layer-list>
\ No newline at end of file
......@@ -8,13 +8,11 @@
tools:context=".ui.InAppWebViewActivity">
<RelativeLayout
android:id="@+id/webViewHeader"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@android:color/black">
<ImageView
android:id="@+id/backIV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
......
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/login_scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbarStyle="insideOverlay">
......
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
android:focusableInTouchMode="true"
android:scrollbarStyle="insideOverlay">
<RelativeLayout
android:id="@+id/main_lyt"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/toolbar" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:layout_below="@+id/main_lyt"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:orientation="vertical">
<TextView
android:id="@+id/text_hint_pswd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="100dp"
android:text="Password length should be at least 8 characters long and should contain one capital letter and @."
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="70dp"
android:layout_centerVertical="true"
android:background="#fff"
android:layout_below="@+id/text_hint_pswd"
android:gravity="center"
android:orientation="vertical">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dip" >
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:layout_marginBottom="0dp">
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/extra_large_margin"
android:layout_marginRight="@dimen/extra_large_margin"
android:background="@drawable/username_under_bg_box"
android:drawableLeft="@mipmap/ic_password_icon"
android:hint="@string/password_string"
android:inputType="textPassword"
android:lines="1"
android:padding="@dimen/normal_margin"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<ImageView
android:id="@+id/password_show"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:visibility="visible"
android:layout_centerVertical="true"
android:src="@drawable/ic_password_show" />
<ImageView
android:id="@+id/password_hide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:visibility="gone"
android:layout_centerVertical="true"
android:src="@drawable/ic_show_password" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dip" >
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:layout_marginBottom="0dp">
<EditText
android:id="@+id/confirm_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/extra_large_margin"
android:layout_marginRight="@dimen/extra_large_margin"
android:background="@drawable/username_under_bg_box"
android:drawableLeft="@mipmap/ic_password_icon"
android:hint="@string/confirm_password_string"
android:inputType="textPassword"
android:lines="1"
android:padding="@dimen/normal_margin"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<ImageView
android:id="@+id/confirm_password_show"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:visibility="visible"
android:layout_centerVertical="true"
android:src="@drawable/ic_password_show" />
<ImageView
android:id="@+id/confirm_password_hide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:visibility="gone"
android:layout_centerVertical="true"
android:src="@drawable/ic_show_password" />
</RelativeLayout>
<TextView
android:id="@+id/submit_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/extra_large_margin"
android:layout_marginTop="50dp"
android:layout_marginRight="@dimen/extra_large_margin"
android:layout_marginBottom="@dimen/normal_margin"
android:background="@drawable/login_bg"
android:gravity="center"
android:paddingTop="@dimen/normal_margin"
android:paddingBottom="@dimen/normal_margin"
android:text="@string/login_screen_submit_string"
android:textColor="@android:color/white"
android:textSize="@dimen/large_text_size" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
</ScrollView>
......@@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
style="@style/LightBackgroundStyle"
android:layout_width="match_parent"
android:background="@drawable/chat_back_bg"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ui.ChatActivity">
......@@ -46,9 +47,9 @@
android:gravity="center_vertical"
android:orientation="vertical"
android:layout_marginTop="@dimen/small_margin"
android:background="@color/screen_bg_color_white"
android:paddingLeft="5dp"
android:paddingRight="5dp">
android:paddingRight="5dp"
android:weightSum="100">
<LinearLayout
android:layout_width="match_parent"
......@@ -76,7 +77,12 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:orientation="horizontal"
android:weightSum="100">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="80">
<EditText
android:id="@+id/message_input"
android:layout_width="0dp"
......@@ -92,6 +98,13 @@
android:imeOptions="actionSend"
android:inputType="textMultiLine"
tools:ignore="InvalidImeActionId" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="20">
<ImageButton
android:id="@+id/voice_button"
android:layout_width="30dp"
......@@ -112,9 +125,12 @@
android:background="@drawable/ic_send_chat"
android:visibility="visible"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
......
......@@ -58,7 +58,6 @@
android:id="@+id/home_screen_grid_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/home_background"
android:horizontalSpacing="@dimen/large_margin"
android:numColumns="2"
android:layout_marginTop="0dp"
......
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="@dimen/spacing">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:gravity="right"
android:orientation="vertical"
android:layout_marginLeft="@dimen/chat_margin"
android:layout_marginRight="@dimen/normal_margin"
android:background="@color/user_background_chat_color"
android:paddingBottom="@dimen/small_margin"
android:paddingTop="@dimen/small_margin">
<TextView
android:id="@+id/user_username"
style="?android:textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/spacing"
android:paddingRight="@dimen/spacing"
android:singleLine="true"
android:textColor="?android:textColorPrimary"
android:textStyle="bold" />
<TextView
android:id="@+id/user_message"
style="?android:textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/spacing"
android:paddingRight="@dimen/spacing"
android:textColor="?android:textColorPrimary" />
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/normal_margin"
android:layout_marginRight="@dimen/chat_margin"
android:background="@color/hr_background_chat_color"
android:paddingBottom="@dimen/small_margin"
android:paddingTop="@dimen/small_margin">
<TextView
android:id="@+id/hr_username"
style="?android:textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:paddingLeft="@dimen/spacing"
android:paddingRight="@dimen/spacing"
android:singleLine="true"
android:textColor="?android:textColorPrimary"
android:textStyle="bold" />
<TextView
android:id="@+id/hr_message"
style="?android:textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@id/hr_username"
android:paddingLeft="@dimen/spacing"
android:paddingRight="@dimen/spacing"
android:textColor="?android:textColorPrimary" />
</RelativeLayout>
</LinearLayout>
......@@ -31,9 +31,9 @@
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/user_icon"
android:layout_marginRight="@dimen/small_margin"
android:background="@drawable/input_box_border"
android:paddingTop="@dimen/small_margin"
android:paddingBottom="@dimen/small_margin"
android:background="@drawable/chat_text_bg"
android:orientation="vertical">
<TextView
......@@ -59,7 +59,7 @@
android:layout_height="wrap_content"
android:paddingLeft="@dimen/spacing"
android:paddingRight="@dimen/spacing"
android:textColor="#fff" />
android:textColor="#000" />
</RelativeLayout>
</RelativeLayout>
......@@ -100,10 +100,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:background="@drawable/box_border"
android:layout_toRightOf="@id/hr_image_view"
android:background="@drawable/chat_text_pharmcy_bg"
android:paddingTop="@dimen/small_margin"
android:paddingBottom="@dimen/small_margin">
android:paddingBottom="@dimen/normal_margin">
<TextView
android:id="@+id/hr_username"
......@@ -116,9 +116,15 @@
android:textColor="?android:textColorPrimary"
android:textStyle="bold"
android:visibility="gone" />
<LinearLayout
android:id="@+id/hr_button_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/hr_username"
android:orientation="vertical"
android:paddingLeft="@dimen/spacing"
android:paddingRight="@dimen/spacing"
android:visibility="gone" />
<TextView
android:id="@+id/hr_message"
......
......@@ -6,9 +6,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:background="#303030"
android:background="#133E55"
android:minHeight="?attr/actionBarSize"
android:padding="0dp"
android:textAlignment="center"
android:gravity="center"
app:titleTextColor="@color/screen_bg_color_white"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
......

2 KB | W: | H:

1.59 KB | W: | H:

app/src/main/res/mipmap-mdpi/ic_launcher.png
app/src/main/res/mipmap-mdpi/ic_launcher.png
app/src/main/res/mipmap-mdpi/ic_launcher.png
app/src/main/res/mipmap-mdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin

10.9 KB | W: | H:

977 Bytes | W: | H:

app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin

1.59 KB | W: | H:

3.22 KB | W: | H:

app/src/vportal/res/mipmap-hdpi/ic_launcher.png
app/src/vportal/res/mipmap-hdpi/ic_launcher.png
app/src/vportal/res/mipmap-hdpi/ic_launcher.png
app/src/vportal/res/mipmap-hdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin

977 Bytes | W: | H:

1.59 KB | W: | H:

app/src/vportal/res/mipmap-mdpi/ic_launcher.png
app/src/vportal/res/mipmap-mdpi/ic_launcher.png
app/src/vportal/res/mipmap-mdpi/ic_launcher.png
app/src/vportal/res/mipmap-mdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin

2.44 KB | W: | H:

4.61 KB | W: | H:

app/src/vportal/res/mipmap-xhdpi/ic_launcher.png
app/src/vportal/res/mipmap-xhdpi/ic_launcher.png
app/src/vportal/res/mipmap-xhdpi/ic_launcher.png
app/src/vportal/res/mipmap-xhdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin

4.59 KB | W: | H:

7.52 KB | W: | H:

app/src/vportal/res/mipmap-xxhdpi/ic_launcher.png
app/src/vportal/res/mipmap-xxhdpi/ic_launcher.png
app/src/vportal/res/mipmap-xxhdpi/ic_launcher.png
app/src/vportal/res/mipmap-xxhdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin

7.07 KB | W: | H:

977 Bytes | W: | H:

app/src/vportal/res/mipmap-xxxhdpi/ic_launcher.png
app/src/vportal/res/mipmap-xxxhdpi/ic_launcher.png
app/src/vportal/res/mipmap-xxxhdpi/ic_launcher.png
app/src/vportal/res/mipmap-xxxhdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin
The file could not be displayed because it is too large.
The file could not be displayed because it is too large.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment