stable build for demo

parent bc71118e
...@@ -91,7 +91,7 @@ android { ...@@ -91,7 +91,7 @@ android {
vportal { vportal {
applicationId "com.vsoft.vera.vportal" applicationId "com.vsoft.vera.vportal"
versionCode 1 versionCode 1
versionName "0.0.6" versionName "0.0.9"
} }
} }
} }
......
...@@ -30,6 +30,7 @@ import android.text.Html; ...@@ -30,6 +30,7 @@ import android.text.Html;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Base64; import android.util.Base64;
import android.util.Log; import android.util.Log;
import android.view.Gravity;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
...@@ -73,6 +74,7 @@ import com.vsoft.vera.utils.CatalogueLog; ...@@ -73,6 +74,7 @@ import com.vsoft.vera.utils.CatalogueLog;
import com.vsoft.vera.utils.Constants; import com.vsoft.vera.utils.Constants;
import com.vsoft.vera.utils.DialogUtils; import com.vsoft.vera.utils.DialogUtils;
import com.vsoft.vera.utils.GenerateRandomString; import com.vsoft.vera.utils.GenerateRandomString;
import com.vsoft.vera.utils.NetworkConnectivity;
import com.vsoft.vera.utils.PermissionService; import com.vsoft.vera.utils.PermissionService;
import com.vsoft.vera.utils.PrefManager; import com.vsoft.vera.utils.PrefManager;
import com.vsoft.vera.utils.Util; import com.vsoft.vera.utils.Util;
...@@ -159,7 +161,7 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD ...@@ -159,7 +161,7 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
private boolean isBlur = false; private boolean isBlur = false;
private Mat imageMat; private Mat imageMat;
private ImageButton sendButton; private ImageButton sendButton;
private final static String INIT_MSG = "Welcom"; private final static String INIT_MSG = "hi";
private String chatHistroy= ""; private String chatHistroy= "";
String ChatHistorybase64; String ChatHistorybase64;
/** /**
...@@ -326,9 +328,13 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD ...@@ -326,9 +328,13 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
sendButton.setOnClickListener(new View.OnClickListener() { sendButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (NetworkConnectivity.haveNetworkConnection(ChatActivity.this)) {
CURRENT_STATE = TYPING_STATE; CURRENT_STATE = TYPING_STATE;
attemptSend(); attemptSend();
} else {
DialogUtils.showNoConnectionDialog(ChatActivity.this);
}
} }
}); });
sendImageToserv.setOnClickListener(new View.OnClickListener() { sendImageToserv.setOnClickListener(new View.OnClickListener() {
...@@ -635,15 +641,17 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD ...@@ -635,15 +641,17 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
* This method calls when we will send message to server. * This method calls when we will send message to server.
*/ */
private void attemptSend() { private void attemptSend() {
String message = mInputMessageView.getText().toString().trim();
if (!TextUtils.isEmpty(message)){
if (null == mLoggedInUsername) return; if (null == mLoggedInUsername) return;
if (!mSocket.connected()) return; if (!mSocket.connected()) return;
textDotLoader.show();
//Whenever we'll click on send button, running TTS speak should stop //Whenever we'll click on send button, running TTS speak should stop
if(speaker != null && speaker.isSpeaking()) { if(speaker != null && speaker.isSpeaking()) {
speaker.stop(); speaker.stop();
} }
textDotLoader.show();
String message = mInputMessageView.getText().toString().trim();
if (TextUtils.isEmpty(message)) { if (TextUtils.isEmpty(message)) {
mInputMessageView.requestFocus(); mInputMessageView.requestFocus();
return; return;
...@@ -665,6 +673,20 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD ...@@ -665,6 +673,20 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
e.printStackTrace(); e.printStackTrace();
} }
mSocket.emit(NEW_MESSAGE, jsonObject); mSocket.emit(NEW_MESSAGE, jsonObject);
}else {
Toast toast = Toast.makeText(getApplicationContext(), "Please enter the message", Toast.LENGTH_LONG);
View toastView = toast.getView(); // This'll return the default View of the Toast.
/* And now you can get the TextView of the default View of the Toast. */
TextView toastMessage = (TextView) toastView.findViewById(android.R.id.message);
toastMessage.setTextSize(15);
toastMessage.setTextColor(Color.WHITE);
toastMessage.setGravity(Gravity.CENTER);
toastMessage.setPadding(30,0,30,0);
toastView.setBackgroundColor(Color.BLACK);
toast.show();
}
} }
@Override @Override
...@@ -696,6 +718,10 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD ...@@ -696,6 +718,10 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
public void initChatMessage(String message) { public void initChatMessage(String message) {
// textDotLoader.show(); // textDotLoader.show();
if(message.contains("stop")){
addMessage(mLoggedInUsername, message,"");
}
//Loading and Display Help Info on the first time ChatBoat opens //Loading and Display Help Info on the first time ChatBoat opens
if (mMessages != null && mMessages.size() == 0) { if (mMessages != null && mMessages.size() == 0) {
// perform the sending message attempt. // perform the sending message attempt.
...@@ -743,8 +769,18 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD ...@@ -743,8 +769,18 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
Toast.makeText(getApplicationContext(),
R.string.error_connect, Toast.LENGTH_LONG).show(); Toast toast = Toast.makeText(getApplicationContext(), R.string.error_connect, Toast.LENGTH_LONG);
View toastView = toast.getView(); // This'll return the default View of the Toast.
/* And now you can get the TextView of the default View of the Toast. */
TextView toastMessage = (TextView) toastView.findViewById(android.R.id.message);
toastMessage.setTextSize(15);
toastMessage.setTextColor(Color.WHITE);
toastMessage.setGravity(Gravity.CENTER);
toastMessage.setPadding(30,0,30,0);
toastView.setBackgroundColor(Color.BLACK);
toast.show();
} }
}); });
} }
...@@ -758,13 +794,15 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD ...@@ -758,13 +794,15 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
public void call(final Object... args) { public void call(final Object... args) {
/*Reset this flag every time*/ /*Reset this flag every time*/
mIsConversationEnd = false; mIsConversationEnd = false;
runOnUiThread(new Runnable() {
@Override
public void run() {
handlerDelayMessage.postDelayed(new Runnable() { handlerDelayMessage.postDelayed(new Runnable() {
@Override @Override
public void run() { public void run() {
// runOnUiThread(new Runnable() {
// @Override
// public void run() {
JSONObject data = (JSONObject) args[0]; JSONObject data = (JSONObject) args[0];
String username; String username;
String message; String message;
...@@ -825,18 +863,24 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD ...@@ -825,18 +863,24 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
} }
} }
}, 300); }, 200);
handlerDelayMessage.postDelayed(new Runnable() { handlerDelayMessage.postDelayed(new Runnable() {
@Override @Override
public void run() { public void run() {
runOnUiThread(new Runnable() {
@Override
public void run() {
textDotLoader.hide(); textDotLoader.hide();
} }
}, 300);
}
}); });
}
}, 180);
// }
// });
} }
}; };
...@@ -935,7 +979,7 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD ...@@ -935,7 +979,7 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
public void onActivityResult(int requestCode, int resultCode, public void onActivityResult(int requestCode, int resultCode,
Intent data) { Intent data) {
if (resultCode == RESULT_OK) { // if (resultCode == RESULT_OK) {
if (requestCode == CHECK_CODE) { if (requestCode == CHECK_CODE) {
if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) { if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
speaker = new Speaker(this); speaker = new Speaker(this);
...@@ -987,12 +1031,17 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD ...@@ -987,12 +1031,17 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
} else if (requestCode == Constants.LOGIN_SCREEN_REQUEST_CODE) { } else if (requestCode == Constants.LOGIN_SCREEN_REQUEST_CODE) {
} else if (requestCode == TAKE_PHOTO) { } else if (requestCode == TAKE_PHOTO) {
if(data != null ){
if (takePictureFilePath != null && !takePictureFilePath.isEmpty()) { if (takePictureFilePath != null && !takePictureFilePath.isEmpty()) {
processImageAsBitmap(takePictureFilePath); processImageAsBitmap(takePictureFilePath);
} }
}else {
initChatMessage("stop");
} }
} }
// }
} }
public void reTakePhoto() { public void reTakePhoto() {
AlertDialog.Builder builder = new AlertDialog.Builder(this); AlertDialog.Builder builder = new AlertDialog.Builder(this);
...@@ -1125,6 +1174,7 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD ...@@ -1125,6 +1174,7 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
public void onResume() public void onResume()
{ {
super.onResume(); super.onResume();
mSocket.connect();
if (!OpenCVLoader.initDebug()) { if (!OpenCVLoader.initDebug()) {
Log.d("OpenCV", "Internal OpenCV library not found. Using OpenCV Manager for initialization"); Log.d("OpenCV", "Internal OpenCV library not found. Using OpenCV Manager for initialization");
OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_0_0, this, mLoaderCallback); OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_0_0, this, mLoaderCallback);
......
...@@ -42,6 +42,7 @@ public class HomeScreen extends HandleNotificationActivity { ...@@ -42,6 +42,7 @@ public class HomeScreen extends HandleNotificationActivity {
Toolbar mToolbar; Toolbar mToolbar;
@BindView(R.id.home_screen_grid_view) @BindView(R.id.home_screen_grid_view)
GridView mGridView; GridView mGridView;
private int pos;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
...@@ -61,12 +62,10 @@ public class HomeScreen extends HandleNotificationActivity { ...@@ -61,12 +62,10 @@ public class HomeScreen extends HandleNotificationActivity {
@OnItemClick(R.id.home_screen_grid_view) @OnItemClick(R.id.home_screen_grid_view)
void gridViewItemClicked(int position) { void gridViewItemClicked(int position) {
pos=position;
int permission_camera = ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA); int permission_camera = ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA);
int permissionResult_storage = ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE); int permissionResult_storage = ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
if( (permission_camera == PackageManager.PERMISSION_GRANTED) && if( (permission_camera == PackageManager.PERMISSION_GRANTED) && (permissionResult_storage == PackageManager.PERMISSION_GRANTED)){
(permissionResult_storage == PackageManager.PERMISSION_GRANTED)
){
HomeScreenMenuItemData homeScreenMenuItemData = MenuProvider.MENU_ITEMS.get(position); HomeScreenMenuItemData homeScreenMenuItemData = MenuProvider.MENU_ITEMS.get(position);
Intent intent = new Intent(this, homeScreenMenuItemData.getActivity()); Intent intent = new Intent(this, homeScreenMenuItemData.getActivity());
startActivity(intent); startActivity(intent);
...@@ -80,7 +79,7 @@ public class HomeScreen extends HandleNotificationActivity { ...@@ -80,7 +79,7 @@ public class HomeScreen extends HandleNotificationActivity {
@OnClick(R.id.nav_back) @OnClick(R.id.nav_back)
void homeIconClicked() { void homeIconClicked() {
//Below dialog will appear in only debug mode. //Below dialog will appear in only debug mode.
if(BuildConfig.BUILD_TYPE_INT == 1) { if(BuildConfig.BUILD_TYPE_INT == 1 ||BuildConfig.BUILD_TYPE_INT == 3 ) {
AlertDialog.Builder builder = new AlertDialog.Builder(this); AlertDialog.Builder builder = new AlertDialog.Builder(this);
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("ServiceNow Instance: "); stringBuilder.append("ServiceNow Instance: ");
...@@ -89,14 +88,14 @@ public class HomeScreen extends HandleNotificationActivity { ...@@ -89,14 +88,14 @@ public class HomeScreen extends HandleNotificationActivity {
stringBuilder.append("Socket URL: "); stringBuilder.append("Socket URL: ");
stringBuilder.append(Constants.CHAT_SERVER_URL); stringBuilder.append(Constants.CHAT_SERVER_URL);
stringBuilder.append("\n"); stringBuilder.append("\n");
stringBuilder.append("Build Version: ");
stringBuilder.append(BuildConfig.VERSION_NAME);
stringBuilder.append("\n");
stringBuilder.append("Flavor: "); stringBuilder.append("Flavor: ");
stringBuilder.append(BuildConfig.FLAVOR); stringBuilder.append(BuildConfig.FLAVOR);
stringBuilder.append("\n"); stringBuilder.append("\n");
stringBuilder.append("Build Type: "); stringBuilder.append("Build Type: ");
stringBuilder.append(BuildConfig.BUILD_TYPE); stringBuilder.append(BuildConfig.BUILD_TYPE);
stringBuilder.append("\n");
stringBuilder.append("\n");
stringBuilder.append("Version: "+BuildConfig.VERSION_NAME);
builder.setMessage(stringBuilder.toString()) builder.setMessage(stringBuilder.toString())
.setTitle("App Info") .setTitle("App Info")
.setCancelable(false) .setCancelable(false)
...@@ -253,13 +252,18 @@ public class HomeScreen extends HandleNotificationActivity { ...@@ -253,13 +252,18 @@ public class HomeScreen extends HandleNotificationActivity {
for (int grant : grantResults) { for (int grant : grantResults) {
if (grant == PackageManager.PERMISSION_DENIED) { if (grant == PackageManager.PERMISSION_DENIED) {
i++; i++;
} }
} }
if(i==grantResults.length){ if(i==grantResults.length){
checkCameraPermissionSettings();
}else{ }else{
HomeScreenMenuItemData homeScreenMenuItemData = MenuProvider.MENU_ITEMS.get(pos);
Intent intent = new Intent(this, homeScreenMenuItemData.getActivity());
startActivity(intent);
checkCameraPermissionSettings();
} }
} }
......
package com.vsoft.vera.utils;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
public class NetworkConnectivity {
public static boolean haveNetworkConnection(Context ct) {
boolean haveConnectedWifi = false;
boolean haveConnectedMobile = false;
ConnectivityManager cm = (ConnectivityManager) ct.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo[] netInfo = cm.getAllNetworkInfo();
for (NetworkInfo ni : netInfo) {
if (ni.getTypeName().equalsIgnoreCase("WIFI"))
if (ni.isConnected())
haveConnectedWifi = true;
if (ni.getTypeName().equalsIgnoreCase("MOBILE"))
if (ni.isConnected())
haveConnectedMobile = true;
}
return haveConnectedWifi || haveConnectedMobile;
}
}

20.1 KB | W: | H:

5.84 KB | W: | H:

app/src/main/res/drawable/ic_login_banner.jpg
app/src/main/res/drawable/ic_login_banner.jpg
app/src/main/res/drawable/ic_login_banner.jpg
app/src/main/res/drawable/ic_login_banner.jpg
  • 2-up
  • Swipe
  • Onion skin
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginTop="50dp"
android:orientation="vertical"> android:orientation="vertical">
<EditText <EditText
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="100dp" android:layout_marginTop="100dp"
android:text="Password length should be at least 8 characters long and should contain one capital letter and @." android:text="Password must be at least 8 characters long.\nIt should include:uppercase letters,lowercase letters,numbers and special character‘@’."
/> />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/extra_large_margin" android:layout_marginLeft="@dimen/extra_large_margin"
android:layout_marginRight="@dimen/extra_large_margin" android:layout_marginRight="@dimen/extra_large_margin"
android:textColor="#000"
android:background="@drawable/username_under_bg_box" android:background="@drawable/username_under_bg_box"
android:drawableLeft="@mipmap/ic_password_icon" android:drawableLeft="@mipmap/ic_password_icon"
android:hint="@string/password_string" android:hint="@string/password_string"
...@@ -116,6 +117,7 @@ ...@@ -116,6 +117,7 @@
android:drawableLeft="@mipmap/ic_password_icon" android:drawableLeft="@mipmap/ic_password_icon"
android:hint="@string/confirm_password_string" android:hint="@string/confirm_password_string"
android:inputType="textPassword" android:inputType="textPassword"
android:textColor="#000"
android:lines="1" android:lines="1"
android:padding="@dimen/normal_margin" android:padding="@dimen/normal_margin"
android:singleLine="true" /> android:singleLine="true" />
......
...@@ -23,11 +23,13 @@ ...@@ -23,11 +23,13 @@
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/messages" android:id="@+id/messages"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginBottom="@dimen/normal_margin" android:layout_marginBottom="30dp"
android:scrollbarStyle="outsideOverlay"
android:scrollbars="vertical" /> android:scrollbars="vertical" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<com.wang.avi.AVLoadingIndicatorView <com.wang.avi.AVLoadingIndicatorView
android:id="@+id/avi" android:id="@+id/avi"
style="@style/AVLoadingIndicatorView" style="@style/AVLoadingIndicatorView"
...@@ -37,6 +39,8 @@ ...@@ -37,6 +39,8 @@
android:visibility="gone" android:visibility="gone"
app:indicatorColor="#03A9F4" app:indicatorColor="#03A9F4"
app:indicatorName="BallPulseIndicator" /> app:indicatorName="BallPulseIndicator" />
</LinearLayout>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:horizontalSpacing="@dimen/large_margin" android:horizontalSpacing="@dimen/large_margin"
android:numColumns="2" android:numColumns="2"
android:layout_marginBottom="20dp"
android:layout_marginTop="0dp" android:layout_marginTop="0dp"
android:stretchMode="columnWidth" android:stretchMode="columnWidth"
android:verticalSpacing="@dimen/large_margin" /> android:verticalSpacing="@dimen/large_margin" />
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
<string name="username_string">Username</string> <string name="username_string">Username</string>
<string name="password_string">Password</string> <string name="password_string">Password</string>
<string name="confirm_password_string">Confirm Password</string> <string name="confirm_password_string">Confirm Password</string>
<string name="home_screen_logout_string">Ver: %1$s</string>
<!--Variable Screen--> <!--Variable Screen-->
<string name="variable_form_mandatory_toast_string">Fields marked with an asterisk(*) are mandatory.</string> <string name="variable_form_mandatory_toast_string">Fields marked with an asterisk(*) are mandatory.</string>
......
...@@ -13,13 +13,15 @@ ...@@ -13,13 +13,15 @@
android:orientation="vertical"> android:orientation="vertical">
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="250dp"
android:layout_height="wrap_content" android:layout_height="150dp"
android:background="@drawable/ic_login_banner" /> android:layout_marginTop="30dp"
android:background="@drawable/splash_screen_new" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginTop="50dp"
android:orientation="vertical"> android:orientation="vertical">
...@@ -37,7 +39,6 @@ ...@@ -37,7 +39,6 @@
android:layout_marginRight="@dimen/extra_large_margin" android:layout_marginRight="@dimen/extra_large_margin"
android:background="@drawable/username_under_bg_box" android:background="@drawable/username_under_bg_box"
android:drawableLeft="@mipmap/ic_user_icon" android:drawableLeft="@mipmap/ic_user_icon"
android:hint="@string/username_string" android:hint="@string/username_string"
android:lines="1" android:lines="1"
android:padding="@dimen/normal_margin" android:padding="@dimen/normal_margin"
......
The file could not be displayed because it is too large.
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"0.0.6","enabled":true,"outputFile":"app-vportal-staging.apk","fullName":"vportalStaging","baseName":"vportal-staging"},"path":"app-vportal-staging.apk","properties":{}}] [{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"0.0.9","enabled":true,"outputFile":"app-vportal-staging.apk","fullName":"vportalStaging","baseName":"vportal-staging"},"path":"app-vportal-staging.apk","properties":{}}]
\ No newline at end of file \ No newline at end of file
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