stable build for demo

parent bc71118e
......@@ -91,7 +91,7 @@ android {
vportal {
applicationId "com.vsoft.vera.vportal"
versionCode 1
versionName "0.0.6"
versionName "0.0.9"
}
}
}
......
......@@ -30,6 +30,7 @@ import android.text.Html;
import android.text.TextUtils;
import android.util.Base64;
import android.util.Log;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
......@@ -73,6 +74,7 @@ import com.vsoft.vera.utils.CatalogueLog;
import com.vsoft.vera.utils.Constants;
import com.vsoft.vera.utils.DialogUtils;
import com.vsoft.vera.utils.GenerateRandomString;
import com.vsoft.vera.utils.NetworkConnectivity;
import com.vsoft.vera.utils.PermissionService;
import com.vsoft.vera.utils.PrefManager;
import com.vsoft.vera.utils.Util;
......@@ -159,7 +161,7 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
private boolean isBlur = false;
private Mat imageMat;
private ImageButton sendButton;
private final static String INIT_MSG = "Welcom";
private final static String INIT_MSG = "hi";
private String chatHistroy= "";
String ChatHistorybase64;
/**
......@@ -326,9 +328,13 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
sendButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (NetworkConnectivity.haveNetworkConnection(ChatActivity.this)) {
CURRENT_STATE = TYPING_STATE;
attemptSend();
} else {
DialogUtils.showNoConnectionDialog(ChatActivity.this);
}
}
});
sendImageToserv.setOnClickListener(new View.OnClickListener() {
......@@ -635,15 +641,17 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
* This method calls when we will send message to server.
*/
private void attemptSend() {
String message = mInputMessageView.getText().toString().trim();
if (!TextUtils.isEmpty(message)){
if (null == mLoggedInUsername) return;
if (!mSocket.connected()) return;
textDotLoader.show();
//Whenever we'll click on send button, running TTS speak should stop
if(speaker != null && speaker.isSpeaking()) {
speaker.stop();
}
textDotLoader.show();
String message = mInputMessageView.getText().toString().trim();
if (TextUtils.isEmpty(message)) {
mInputMessageView.requestFocus();
return;
......@@ -665,6 +673,20 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
e.printStackTrace();
}
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
......@@ -696,6 +718,10 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
public void initChatMessage(String message) {
// textDotLoader.show();
if(message.contains("stop")){
addMessage(mLoggedInUsername, message,"");
}
//Loading and Display Help Info on the first time ChatBoat opens
if (mMessages != null && mMessages.size() == 0) {
// perform the sending message attempt.
......@@ -743,8 +769,18 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
runOnUiThread(new Runnable() {
@Override
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
public void call(final Object... args) {
/*Reset this flag every time*/
mIsConversationEnd = false;
runOnUiThread(new Runnable() {
@Override
public void run() {
handlerDelayMessage.postDelayed(new Runnable() {
@Override
public void run() {
// runOnUiThread(new Runnable() {
// @Override
// public void run() {
JSONObject data = (JSONObject) args[0];
String username;
String message;
......@@ -825,18 +863,24 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
}
}
}, 300);
}, 200);
handlerDelayMessage.postDelayed(new Runnable() {
@Override
public void run() {
runOnUiThread(new Runnable() {
@Override
public void run() {
textDotLoader.hide();
}
}, 300);
}
});
}
}, 180);
// }
// });
}
};
......@@ -935,7 +979,7 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
public void onActivityResult(int requestCode, int resultCode,
Intent data) {
if (resultCode == RESULT_OK) {
// if (resultCode == RESULT_OK) {
if (requestCode == CHECK_CODE) {
if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
speaker = new Speaker(this);
......@@ -987,12 +1031,17 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
} else if (requestCode == Constants.LOGIN_SCREEN_REQUEST_CODE) {
} else if (requestCode == TAKE_PHOTO) {
if(data != null ){
if (takePictureFilePath != null && !takePictureFilePath.isEmpty()) {
processImageAsBitmap(takePictureFilePath);
}
}else {
initChatMessage("stop");
}
}
// }
}
public void reTakePhoto() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
......@@ -1125,6 +1174,7 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
public void onResume()
{
super.onResume();
mSocket.connect();
if (!OpenCVLoader.initDebug()) {
Log.d("OpenCV", "Internal OpenCV library not found. Using OpenCV Manager for initialization");
OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_0_0, this, mLoaderCallback);
......
......@@ -42,6 +42,7 @@ public class HomeScreen extends HandleNotificationActivity {
Toolbar mToolbar;
@BindView(R.id.home_screen_grid_view)
GridView mGridView;
private int pos;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -61,12 +62,10 @@ public class HomeScreen extends HandleNotificationActivity {
@OnItemClick(R.id.home_screen_grid_view)
void gridViewItemClicked(int position) {
pos=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)
){
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);
......@@ -80,7 +79,7 @@ public class HomeScreen extends HandleNotificationActivity {
@OnClick(R.id.nav_back)
void homeIconClicked() {
//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);
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("ServiceNow Instance: ");
......@@ -89,14 +88,14 @@ public class HomeScreen extends HandleNotificationActivity {
stringBuilder.append("Socket URL: ");
stringBuilder.append(Constants.CHAT_SERVER_URL);
stringBuilder.append("\n");
stringBuilder.append("Build Version: ");
stringBuilder.append(BuildConfig.VERSION_NAME);
stringBuilder.append("\n");
stringBuilder.append("Flavor: ");
stringBuilder.append(BuildConfig.FLAVOR);
stringBuilder.append("\n");
stringBuilder.append("Build Type: ");
stringBuilder.append(BuildConfig.BUILD_TYPE);
stringBuilder.append("\n");
stringBuilder.append("\n");
stringBuilder.append("Version: "+BuildConfig.VERSION_NAME);
builder.setMessage(stringBuilder.toString())
.setTitle("App Info")
.setCancelable(false)
......@@ -253,13 +252,18 @@ public class HomeScreen extends HandleNotificationActivity {
for (int grant : grantResults) {
if (grant == PackageManager.PERMISSION_DENIED) {
i++;
}
}
if(i==grantResults.length){
checkCameraPermissionSettings();
}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 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="50dp"
android:orientation="vertical">
<EditText
......
......@@ -32,7 +32,7 @@
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 @."
android:text="Password must be at least 8 characters long.\nIt should include:uppercase letters,lowercase letters,numbers and special character‘@’."
/>
<LinearLayout
android:layout_width="match_parent"
......@@ -64,6 +64,7 @@
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/extra_large_margin"
android:layout_marginRight="@dimen/extra_large_margin"
android:textColor="#000"
android:background="@drawable/username_under_bg_box"
android:drawableLeft="@mipmap/ic_password_icon"
android:hint="@string/password_string"
......@@ -116,6 +117,7 @@
android:drawableLeft="@mipmap/ic_password_icon"
android:hint="@string/confirm_password_string"
android:inputType="textPassword"
android:textColor="#000"
android:lines="1"
android:padding="@dimen/normal_margin"
android:singleLine="true" />
......
......@@ -23,11 +23,13 @@
<android.support.v7.widget.RecyclerView
android:id="@+id/messages"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginBottom="@dimen/normal_margin"
android:scrollbarStyle="outsideOverlay"
android:layout_marginBottom="30dp"
android:scrollbars="vertical" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<com.wang.avi.AVLoadingIndicatorView
android:id="@+id/avi"
style="@style/AVLoadingIndicatorView"
......@@ -37,6 +39,8 @@
android:visibility="gone"
app:indicatorColor="#03A9F4"
app:indicatorName="BallPulseIndicator" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
......
......@@ -60,6 +60,7 @@
android:layout_height="match_parent"
android:horizontalSpacing="@dimen/large_margin"
android:numColumns="2"
android:layout_marginBottom="20dp"
android:layout_marginTop="0dp"
android:stretchMode="columnWidth"
android:verticalSpacing="@dimen/large_margin" />
......
......@@ -58,6 +58,7 @@
<string name="username_string">Username</string>
<string name="password_string">Password</string>
<string name="confirm_password_string">Confirm Password</string>
<string name="home_screen_logout_string">Ver: %1$s</string>
<!--Variable Screen-->
<string name="variable_form_mandatory_toast_string">Fields marked with an asterisk(*) are mandatory.</string>
......
......@@ -13,13 +13,15 @@
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ic_login_banner" />
android:layout_width="250dp"
android:layout_height="150dp"
android:layout_marginTop="30dp"
android:background="@drawable/splash_screen_new" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="50dp"
android:orientation="vertical">
......@@ -37,7 +39,6 @@
android:layout_marginRight="@dimen/extra_large_margin"
android:background="@drawable/username_under_bg_box"
android:drawableLeft="@mipmap/ic_user_icon"
android:hint="@string/username_string"
android:lines="1"
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":{}}]
\ No newline at end of file
[{"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
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