Miko Gitlab Repository
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Anup Gupta
LoginFlowNativeAndroidNew
Commits
c774753d
Commit
c774753d
authored
5 years ago
by
Anup Gupta
Browse files
Options
Download
Email Patches
Plain Diff
Removed unused code and Bug fixed.
parent
a7ad5dac
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3 additions
and
471 deletions
+3
-471
app/src/main/java/com/miko/loginflow/mail_screen/ConnectionsFragment.java
...a/com/miko/loginflow/mail_screen/ConnectionsFragment.java
+1
-84
app/src/main/java/com/miko/loginflow/mail_screen/InitialActivity.java
.../java/com/miko/loginflow/mail_screen/InitialActivity.java
+0
-89
app/src/main/java/com/miko/loginflow/mail_screen/LoginFragment.java
...in/java/com/miko/loginflow/mail_screen/LoginFragment.java
+0
-61
app/src/main/java/com/miko/loginflow/mail_screen/MikoConnectionStatusFragment.java
...o/loginflow/mail_screen/MikoConnectionStatusFragment.java
+1
-236
app/src/main/res/values/strings.xml
app/src/main/res/values/strings.xml
+1
-1
No files found.
app/src/main/java/com/miko/loginflow/mail_screen/ConnectionsFragment.java
View file @
c774753d
...
...
@@ -64,20 +64,14 @@ import static com.miko.loginflow.Utils.writeConfigurationData;
public
class
ConnectionsFragment
extends
BaseFragment
implements
ICommonView
,
onDialogClickCallback
,
GenericDialogClickListener
{
private
View
mView
;
private
CommonPresenter
mPresenter
;
private
String
mMessage
=
""
;
private
ImageView
foundDevice
;
private
TextView
search_text
;
private
Button
btn_cancel_miko
;
Handler
handler
=
null
;
Boolean
isFromDashboard
=
false
;
private
boolean
ErrorLogin
=
false
;
private
static
final
String
TAG
=
"ConnectionFragment"
;
private
FragmentActivity
mActivity
;
private
LottieAnimationView
animationView
;
boolean
isAlreadyConfigured
=
false
;
// private ArrayList<String> finalSubScribedModule;
@Override
public
void
onAttach
(
Context
context
)
{
super
.
onAttach
(
context
);
...
...
@@ -90,15 +84,7 @@ public class ConnectionsFragment extends BaseFragment implements ICommonView, on
((
AppCompatActivity
)
mActivity
).
getSupportActionBar
().
hide
();
mView
=
inflater
.
inflate
(
R
.
layout
.
fragment_miko_connection
,
container
,
false
);
mPresenter
=
new
CommonPresenter
(
mActivity
,
this
);
//this is to start th BLE process and also to get the other miko list----dont removeeee
// Bundle bundle = getArguments();
// if (bundle != null) {
// isFromDashboard = bundle.getBoolean("isFromDashboard", false);
Log
.
e
(
TAG
,
"onCreateView: "
+
isFromDashboard
);
// }
setUserID
(
ParentalPreferences
.
getUserName
(
mActivity
));
return
mView
;
}
...
...
@@ -150,36 +136,11 @@ public class ConnectionsFragment extends BaseFragment implements ICommonView, on
};
private
void
foundDevice
()
{
try
{
search_text
.
setText
(
getResources
().
getString
(
R
.
string
.
mikofound
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
/* if (Utils.getInstance().isNetworkAvailable(mActivity)) {
handler.postDelayed(new Runnable() {
@Override
public void run() {
if (isAlreadyConfigured && !isFromDashboard) {
openDashboard();
} else {
Fragment fragment = new MikoConnectionStatusFragment();
Bundle bundle = new Bundle();
bundle.putBoolean("401", ErrorLogin);
fragment.setArguments(bundle);
int container = R.id.container;
Utils.getInstance().replaceFragment(mActivity, fragment, container, false);
}
}
}, 3000);
} else {
ShowGenericDialog(Constants.NoInternetCase, Constants.OK, mActivity.getResources().getString(R.string.no_internet_message));
}*/
}
@Override
...
...
@@ -266,9 +227,6 @@ public class ConnectionsFragment extends BaseFragment implements ICommonView, on
@Override
public
void
onResponse
(
BotResponseModel
botResponseModel
)
{
if
(
botResponseModel
!=
null
&&
isAdded
())
{
// ((ParentalApplication) getApplication()).saveQbConfig(botResponseModel.getData());
// getAuthID(mActivity);
Log
.
e
(
TAG
,
"oooooooooooo"
);
if
(
botResponseModel
.
getData
().
getFlag
().
equalsIgnoreCase
(
"Proceed"
)
||
botResponseModel
.
getData
().
getFlag
().
equalsIgnoreCase
(
"Associated"
))
{
isAlreadyConfigured
=
true
;
flow
();
...
...
@@ -284,47 +242,10 @@ public class ConnectionsFragment extends BaseFragment implements ICommonView, on
if
(
getConnectedBotsResponse
.
getData
()
!=
null
)
{
Data1
d1
=
getConnectedBotsResponse
.
getData
();
ArrayList
<
String
>
bots
=
d1
.
getBots
();
Log
.
d
(
TAG
,
"LFLFLF Bot Id: "
+
bots
);
codeMasterSubscribedBot
.
clear
();
// finalSubScribedModule = new ArrayList<>();
for
(
int
i
=
0
;
i
<
bots
.
size
();
i
++)
{
mPresenter
.
callAPPModulesAPI
(
ParentalPreferences
.
getInstance
().
getMobileNumber
(
mActivity
),
ParentalPreferences
.
getInstance
().
getBotId
(
mActivity
),
bots
.
get
(
i
)
,
ParentalPreferences
.
getToken
(
mActivity
));
mPresenter
.
callAPPModulesAPI
(
ParentalPreferences
.
getInstance
().
getMobileNumber
(
mActivity
),
bots
.
get
(
i
),
codeMasterModuleNo
,
ParentalPreferences
.
getToken
(
mActivity
));
}
// if (bots != null) {
// for (int i = 0; i < botsSize; i++) {
// Log.d(TAG, "LFLFLF Bot Id: " + bots.get(i));
// MikoConnectionStatusFragment.addToPrevMikoList(bots.get(i));
// if (botsSize > 1 && bots.get(i).equalsIgnoreCase(ParentalPreferences.getBotId(mActivity))) {
// //when there is a bot previously selected and there are more than 1 bot in GetConnectedBotsResponse then move for association
// botAssociates();
// }
// }
// if (botsSize == 1) {
// //when there is 1 bot in GetConnectedBotsResponse then move for bot association
// if (bots.get(0) != null) {
// ParentalPreferences.setBotId(mActivity, bots.get(0));
// }
// botAssociates();
// } else if (botsSize > 1 && TextUtils.isEmpty(ParentalPreferences.getBotId(mActivity))) {
// //as we need some time to get other bots
// if (handler != null) {
// handler.postDelayed(new Runnable() {
// @Override
// public void run() {
// //when there is no bot previously selected and there are more than 1 bot in GetConnectedBotsResponse
// flow();
// }
// }, 2000);
// }
// }
// if (isAlreadyConfigured) {
// isAlreadyConfigured = false;
// }
// }
}
}
else
{
MikoConnectionStatusFragment
.
prevMikoList
.
clear
();
...
...
@@ -336,10 +257,6 @@ public class ConnectionsFragment extends BaseFragment implements ICommonView, on
}
public
void
flow
()
{
// if (isAlreadyConfigured && !isFromDashboard) {
// sendPropertiesMixpanel(ParentalPreferences.getBotId(mActivity));
// openDashboard();
// } else {
Fragment
fragment
=
new
MikoConnectionStatusFragment
();
Bundle
bundle
=
new
Bundle
();
bundle
.
putBoolean
(
"401"
,
ErrorLogin
);
...
...
This diff is collapsed.
Click to expand it.
app/src/main/java/com/miko/loginflow/mail_screen/InitialActivity.java
View file @
c774753d
...
...
@@ -45,22 +45,10 @@ public class InitialActivity extends BaseActivity implements FragmentManager.OnB
public
static
Toolbar
mTopToolbar
;
public
static
TextView
txt_title
;
public
static
ImageView
img_back
;
// private LocationReceiver mLocationReceiver;
private
long
UPDATE_INTERVAL
=
2
*
1000
;
/* 10 secs */
private
long
FASTEST_INTERVAL
=
2000
;
/* 2 sec */
public
static
int
countStart
=
2
;
public
int
countStop
=
2
;
public
static
boolean
stopService
=
false
;
static
Boolean
continueFlowFlag
=
false
;
private
LoaderFragment
loaderFragment
;
private
static
final
String
TAG
=
"InitialActivity"
;
/*CommonPresenter LPresenter;
DataBaseHelper dataBaseHelper;
AppStoreDao baseAppStoreDao;*/
String
gotoFrag
=
""
;
Bundle
bundle
;
private
int
container
;
int
RC_APP_UPDATE
=
100
;
...
...
@@ -101,7 +89,6 @@ public class InitialActivity extends BaseActivity implements FragmentManager.OnB
Log
.
e
(
TAG
,
"initialavyivity: "
+
gotoFrag
);
}
img_back
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
...
...
@@ -113,15 +100,6 @@ public class InitialActivity extends BaseActivity implements FragmentManager.OnB
APIS
.
init
(
""
);
// dataBaseHelper = DataBaseHelper.getInstance(getApplicationContext());
// if (dataBaseHelper != null) {
// baseAppStoreDao = dataBaseHelper.dao();
// LPresenter = new CommonPresenter(this, this, baseAppStoreDao);
// } else {
// Log.e(TAG, "dataBase null ");
// }
if
(
savedInstanceState
==
null
)
{
// * if user is already logged in then go to dashboard else go to authentication screen
if
(
ParentalPreferences
.
isLoggedIn
(
this
))
{
...
...
@@ -142,28 +120,6 @@ public class InitialActivity extends BaseActivity implements FragmentManager.OnB
}
displayLocationSettingsRequest
(
InitialActivity
.
this
);
// FirebaseInstanceId.getInstance().getInstanceId()
// .addOnCompleteListener(new OnCompleteListener<InstanceIdResult>() {
// @Override
// public void onComplete(@NonNull Task<InstanceIdResult> task) {
// if (!task.isSuccessful()) {
// Log.e(TAG, "getInstanceId failed", task.getException());
// return;
// }
//
// // Get new Instance ID token
// String token = task.getResult().getToken();
// ParentalPreferences.setKeyFirebaseToken(InitialActivity.this, token);
//
//
// // Log and toast
//
// Log.e("Token", token.toString());
//// Toast.makeText(InitialActivity.this, token, Toast.LENGTH_SHORT).show();
// }
// });
}
public
void
setTitle
(
String
title
)
{
...
...
@@ -252,12 +208,6 @@ public class InitialActivity extends BaseActivity implements FragmentManager.OnB
this
.
finishAffinity
();
break
;
// case 902:
// Intent intent = new Intent(this, DashboardActivity.class);
// intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
// startActivity(intent);
// break;
default
:
break
;
}
...
...
@@ -275,44 +225,6 @@ public class InitialActivity extends BaseActivity implements FragmentManager.OnB
}
}
/*
InstallStateUpdatedListener installStateUpdatedListener = new
InstallStateUpdatedListener() {
@Override
public void onStateUpdate(InstallState state) {
if (state.installStatus() == InstallStatus.DOWNLOADED) {
popupSnackbarForCompleteUpdate();
} else if (state.installStatus() == InstallStatus.INSTALLED) {
if (appUpdateManager != null) {
appUpdateManager.unregisterListener(installStateUpdatedListener);
}
} else {
Log.i(TAG, "InstallStateUpdatedListener: state: " + state.installStatus());
}
}
};
private void popupSnackbarForCompleteUpdate() {
Log.d(TAG, "onCreate: appUpdateManager 8" + appUpdateManager);
Snackbar snackbar =
Snackbar.make(img_back,
"New app is ready!",
Snackbar.LENGTH_INDEFINITE);
Log.d(TAG, "onCreate: appUpdateManager 9" + appUpdateManager);
snackbar.setAction("Install", view -> {
if (appUpdateManager != null) {
appUpdateManager.completeUpdate();
}
});
snackbar.setActionTextColor(getResources().getColor(R.color.colorPrimary));
snackbar.show();
}*/
public
void
displayLocationSettingsRequest
(
Activity
context
)
{
GoogleApiClient
googleApiClient
=
new
GoogleApiClient
.
Builder
(
context
)
.
addApi
(
LocationServices
.
API
).
build
();
...
...
@@ -353,5 +265,4 @@ public class InitialActivity extends BaseActivity implements FragmentManager.OnB
}
});
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app/src/main/java/com/miko/loginflow/mail_screen/LoginFragment.java
View file @
c774753d
...
...
@@ -63,7 +63,6 @@ public class LoginFragment extends BaseFragment implements ICommonView, onDialog
ImageView
mobile
,
email
;
TextView
mobileno
,
emailaddress
,
txt_privacy_policy
;
EditText
editMobileNo
,
editEmailId
;
//a
//LinearLayout linearemail,linearmobile;
String
mobileNumber
,
emailid
;
//a
Button
btnLogin
;
private
ConstraintLayout
layoutNotMiko
;
...
...
@@ -82,7 +81,6 @@ public class LoginFragment extends BaseFragment implements ICommonView, onDialog
noInternetDialogClick
=
this
;
}
private
final
PermissionCallback
permissionReadstorageCallback
=
new
PermissionCallback
()
{
@Override
public
void
permissionGranted
()
{
...
...
@@ -198,19 +196,6 @@ public class LoginFragment extends BaseFragment implements ICommonView, onDialog
emailaddress
.
setTextColor
(
getResources
().
getColor
(
R
.
color
.
wel_white
));
//linearemail.setBackgroundColor(getResources().getColor(R.color.wel_white));
}
//condition to check if the entered value is int or string
/*mobileNumber = editMobileNo.getText().toString();
if (mobileNumber.equalsIgnoreCase("")) {
ccp.setVisibility(mView.GONE);
}*/
/*boolean digitsOnly = TextUtils.isDigitsOnly(s);
if (digitsOnly) {
if (s.length() != 0) {
ccp.setVisibility(mView.VISIBLE);
} else {
ccp.setVisibility(mView.GONE);
}
}*/
}
});
...
...
@@ -348,33 +333,13 @@ public class LoginFragment extends BaseFragment implements ICommonView, onDialog
Log
.
e
(
TAG
,
"onError:IN sTRINGGGGGGGGGGGG onResponse 4"
);
Utils
.
getInstance
().
showSnackbar
(
getView
(),
getResources
().
getString
(
R
.
string
.
internet_availibility
));
}
else
{
ShowGenericDialog
(
Constants
.
registok
,
Constants
.
OK
,
mActivity
.
getResources
().
getString
(
R
.
string
.
ExceptionAPIFail
));
/*
ViewDialogCustom.customDialog1btn(mActivity, getResources().getString(R.string.ExceptionAPIFail), Constants.OK, Constants.registok, false, this);
*/
}
}
// else{
// if(mobileLogin){
// Log.e(TAG, "onError: IN OBJECT MOB");
// //ViewDialogCustom.customDialog2Btn(mActivity, getResources().getString(R.string.numNotRegistered, mobileNumber), Constants.Cancel, Constants.OK, Constants.editMobile, this);
// ViewDialogCustom.customDialog2Btn(mActivity,error, Constants.Cancel, Constants.OK, Constants.editMobile, this);
// }else{
// Log.e(TAG, "onError: IN OBJECT EMAIL");
// //ViewDialogCustom.customDialog2Btn(mActivity, getResources().getString(R.string.emailidNotRegistered, emailid), Constants.Cancel, Constants.OK, Constants.editEmail, this);
// ViewDialogCustom.customDialog2Btn(mActivity,error, Constants.Cancel, Constants.OK, Constants.editEmail, this);
// }
// }
}
@Override
public
void
onError
(
Object
error
)
{
Log
.
e
(
TAG
,
" IN OBJECT"
+
error
);
// ParentalLoginResponse parentalLoginResponse=new ParentalLoginResponse();
// Gson gson = new Gson()
if
(
error
.
equals
(
401
))
{
//showDialogWithOkAndCancel(mActivity, getResources().getString(R.string.numNotRegistered, mobileNumber), new RegisterFragment(), LoginFragment.this, getResources().getString(R.string.OKDialog), getResources().getString(R.string.CancelDialog), false);
if
(
mobileLogin
)
{
...
...
@@ -401,34 +366,18 @@ public class LoginFragment extends BaseFragment implements ICommonView, onDialog
Log
.
e
(
TAG
,
"onError: IN OBJECT MOB"
);
if
(
parentalLoginResponse
!=
null
)
{
if
(
parentalLoginResponse
.
getStatus
().
equals
(
"error"
)
&&
parentalLoginResponse
.
getMessage
()
!=
null
)
{
ShowGenericDialogWith2Button
(
Constants
.
editMobile
,
Constants
.
OK
,
Constants
.
Cancel
,
parentalLoginResponse
.
getMessage
());
/*
ViewDialogCustom.customDialog2Btn(mActivity, parentalLoginResponse.getMessage(), Constants.Cancel, Constants.OK, Constants.editMobile, this);
*/
}
else
{
ShowGenericDialogWith2Button
(
Constants
.
editMobile
,
Constants
.
OK
,
Constants
.
Cancel
,
mActivity
.
getResources
().
getString
(
R
.
string
.
numNotRegistered
,
mobileNumber
));
/*
ViewDialogCustom.customDialog2Btn(mActivity, getResources().getString(R.string.numNotRegistered, mobileNumber), Constants.Cancel, Constants.OK, Constants.editMobile, this);
*/
}
}
}
else
{
Log
.
e
(
TAG
,
"onError: IN OBJECT EMAIL"
);
if
(
parentalLoginResponse
!=
null
)
{
if
(
parentalLoginResponse
.
getStatus
().
equals
(
"error"
)
&&
parentalLoginResponse
.
getMessage
()
!=
null
)
{
ShowGenericDialogWith2Button
(
Constants
.
editEmail
,
Constants
.
OK
,
Constants
.
Cancel
,
parentalLoginResponse
.
getMessage
());
/*
ViewDialogCustom.customDialog2Btn(mActivity, parentalLoginResponse.getMessage(), Constants.Cancel, Constants.OK, Constants.editEmail, this);
*/
}
else
{
ShowGenericDialogWith2Button
(
Constants
.
editEmail
,
Constants
.
OK
,
Constants
.
Cancel
,
mActivity
.
getResources
().
getString
(
R
.
string
.
emailidNotRegistered
,
emailid
));
/*
ViewDialogCustom.customDialog2Btn(mActivity, getResources().getString(R.string.emailidNotRegistered, emailid), Constants.Cancel, Constants.OK, Constants.editEmail, this);
*/
}
}
}
...
...
@@ -716,20 +665,10 @@ public class LoginFragment extends BaseFragment implements ICommonView, onDialog
super
.
onResume
();
ccp
.
setCountryForNameCode
(
setCountryCode
());
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
// if (arePermissionsEnabled(mActivity)) {
// Utils.getInstance().checkforUpdate(mActivity, getFragmentManager());
// }
// }
if
(!
TextUtils
.
isEmpty
(
editMobileNo
.
getText
().
toString
())
||
!
TextUtils
.
isEmpty
(
editEmailId
.
getText
().
toString
()))
{
enableContinueButton
(
true
);
}
else
{
enableContinueButton
(
false
);
}
}
}
This diff is collapsed.
Click to expand it.
app/src/main/java/com/miko/loginflow/mail_screen/MikoConnectionStatusFragment.java
View file @
c774753d
...
...
@@ -46,7 +46,6 @@ import static com.miko.loginflow.mail_screen.ConnectionsFragment.JoinUnityCodeFr
public
class
MikoConnectionStatusFragment
extends
BaseFragment
implements
ICommonView
,
View
.
OnClickListener
,
onDialogClickCallback
,
GenericDialogClickListener
{
private
View
mView
;
// private ArrayList<MikoFoundListModel> mListofMikos;
private
static
MikoUsersListAdapter
mAdapter
;
private
CommonPresenter
mPresenter
;
public
RecyclerView
mikoconnectionList
;
...
...
@@ -61,102 +60,6 @@ public class MikoConnectionStatusFragment extends BaseFragment implements ICommo
private
boolean
ErrorLogin
=
false
;
private
FragmentActivity
mActivity
;
private
ConstraintLayout
layoutMikoList
,
layoutMikoNotFound
;
private
String
oldBotNo
;
// @Override
// public void onCreate(@Nullable Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// setHasOptionsMenu(true);
// mListofMikos = new ArrayList<>();
// getBotList();
// }
// public ArrayList<String> getOtherMikoList() {
// Log.e(TAG, "setMixPanelProperties: " + new Gson().toJson(otherMikoList));
// return otherMikoList;
// }
//
// public static void addToOtherMikoList(String mikoFound) {
// Log.e("ZZZZZ", "addtoother mikos list " + mikoFound);
// if (!otherMikoList.contains(mikoFound)) {
// otherMikoList.add(mikoFound);
// Log.e("addToOtherMikoList", "otherMikoList" + otherMikoList.size());
// }
// }
// @Override
// public void getOtherBotList(String botName) {
// Log.e(TAG, "getOtherBotList: "+botName);
// otherMikoList.add(botName);
// getBotList();
// }
//
//
// public static void addToPrevMikoList(String mikoFound) {
// ArrayList<String> mikoFoundList = new ArrayList<>();
// mikoFoundList.add(mikoFound);
// Log.d("ZZZZZ", "addToPrevMikoList: " + prevMikoList.size() + prevMikoList.toString());
// prevMikoList.add(mikoFound);
//
// }
//
// private void getBotList() {
// setBotListPropsEventsMixpanel(null, codeMasterSubscribedBot, true);
//
// if (mAdapter != null) {
// mAdapter = new MikoUsersListAdapter(codeMasterSubscribedBot);
// mAdapter.notifyDataSetChanged();
// }
//// ArrayList<MikoFoundListModel> mlist = new ArrayList<>();
////
//// if (prevMikoList != null && prevMikoList.size() > 0) {
//// mlist.add(new MikoFoundListModel("PAIRED DEVICES", true, false));
//// for (int k = 0; k < prevMikoList.size(); k++) {
//// Log.e(TAG, "prevMikoList " + prevMikoList.get(k));
//// mlist.add(new MikoFoundListModel(prevMikoList.get(k), false, false));
//// }
//// }
////
//// Log.e(TAG, "prevMikoList: " + mlist.toString());
////
//// if (otherMikoList != null && otherMikoList.size() > 0) {
//// mlist.add(new MikoFoundListModel("OTHER DEVICES", true, false));
//// ArrayList<String> othermikos = getOtherMikoList();
//// for (int i = 0; i < othermikos.size(); i++) {
//// mlist.add(new MikoFoundListModel(otherMikoList.get(i), false, false));
//// }
//// }
////
////// Log.e(TAG, "otherMikoList: "+mlist.toString());
////
////
//// for (int i = 0; i < mlist.size(); i++) {
//// Log.e(TAG, mlist.get(i).botNumber + "ZZZZZZ");
////
//// boolean flag = true;
//// for (int j = 0; j < mListofMikos.size(); j++) {
//// Log.e(TAG, mlist.get(i) + "ZZZZZZ" + ":" + mListofMikos.get(j));
//// if (mListofMikos.get(j).botNumber.equals(mlist.get(i).botNumber)) {
//// flag = false;
//// break;
//// }
//// }
//// if (flag && mlist.get(i).botNumber.startsWith("00")) {
//// Log.e(TAG, mlist.get(i) + "adding" + ":");
//// mListofMikos.add(mlist.get(i));
//// } else if (mlist.get(i).isHeader) {
//// mListofMikos.add(mlist.get(i));
//// }
//// }
////
////// setBotListPropsEventsMixpanel(null, prevMikoList, true);
//// setBotListPropsEventsMixpanel(null, codeMasterSubscribedBot, true);
////
//// if (mAdapter != null) {
//// mAdapter = new MikoUsersListAdapter(mListofMikos);
//// mAdapter.notifyDataSetChanged();
//// }
// }
@Override
public
void
onAttach
(
Context
context
)
{
...
...
@@ -212,20 +115,16 @@ public class MikoConnectionStatusFragment extends BaseFragment implements ICommo
ShowGenericDialog
(
Constants
.
Parentall2
,
Constants
.
Login
,
mActivity
.
getResources
().
getString
(
R
.
string
.
oldToken
),
mActivity
.
getResources
().
getString
(
R
.
string
.
wifi_config_fail_head
));
}
}
}
@Override
public
void
showProgressDialog
()
{
showLoader
();
// super.showProgressBar(getString(R.string.please_wait));
}
@Override
public
void
hideProgressDialog
()
{
hideLoader
();
Log
.
e
(
TAG
,
"hideloader: hideProgressDialog() "
);
// super.hideProgressBar();
}
@Override
...
...
@@ -275,19 +174,9 @@ public class MikoConnectionStatusFragment extends BaseFragment implements ICommo
Log
.
e
(
TAG
,
"onError: IN OBJECT MOB"
);
if
(
botResponseModel
!=
null
)
{
if
(
botResponseModel
.
getStatus
().
equals
(
"error"
)
&&
botResponseModel
.
getMessage
()
!=
null
)
{
ShowGenericDialog
(
Constants
.
Parentall2
,
Constants
.
Login
,
botResponseModel
.
getMessage
(),
""
);
/*
ViewDialogCustom.customDialog1btn(getActivity(), botResponseModel.getMessage(), Constants.Login, Constants.Parentall2, false, this);
*/
}
else
{
Log
.
e
(
TAG
,
"expireeeeeeee: "
);
ShowGenericDialog
(
Constants
.
Parentall2
,
Constants
.
Login
,
mActivity
.
getResources
().
getString
(
R
.
string
.
oldToken
),
mActivity
.
getResources
().
getString
(
R
.
string
.
wifi_config_fail_head
));
/*
ViewDialogCustom.customDialog1btn(getActivity(), getActivity().getResources().getString(R.string.oldToken), Constants.Login, Constants.Parentall2, false, this);
*/
}
}
}
...
...
@@ -301,64 +190,6 @@ public class MikoConnectionStatusFragment extends BaseFragment implements ICommo
@Override
public
void
onResponse
(
BotResponseModel
botResponseModel
)
{
if
(
botResponseModel
!=
null
&&
isAdded
())
{
Log
.
e
(
TAG
,
"oooooooooooo"
);
// if (botResponseModel.getData().getFlag() != null) {
// ((ParentalApplication) getApplication()).saveQbConfig(botResponseModel.getData());
// hideLoader();
// if (botResponseModel.getData().getFlag().equalsIgnoreCase("Proceed") || botResponseModel.getData().getFlag().equalsIgnoreCase("Associated")) {
// // mPresenter.getConfigurationData(ParentalPreferences.getToken(mActivity));
//
// if (botResponseModel != null) {
//// if(ParentalPreferences.getBotId(mActivity).equalsIgnoreCase()) {
// Utils.getInstance().clearWholeDb(mActivity);
//// }
//
// if (botResponseModel.getData().getFlag().equalsIgnoreCase("Associated")) {
//
// sendCurrentBotPropsEventsMixpanel(ParentalPreferences.getBotId(mActivity));
// setBotListPropsEventsMixpanel(ParentalPreferences.getBotId(mActivity), prevMikoList, false);
//
// if (botResponseModel.getData() != null && botResponseModel.getMessage() != null) {
// Constants.setSUCCESSLOGINONBOTASSOCIATION(botResponseModel.getMessage());
// } else {
// Constants.setSUCCESSLOGINONBOTASSOCIATION(botResponseModel.getMessage());
// }
//
// APIS.getAnaliticsMSG(Constants.event_source, Constants.ASSOCAIATION_SUCCESS, Constants.Count, "1");
// //go to PreWiffiConnectionBannerFragment after success
// flagSuccessScreenNo = 2;
// Fragment fragment = new SuccessFragment();
// mActivity.getSupportFragmentManager().beginTransaction()
// .setCustomAnimations(R.anim.fade_in, R.anim.fade_out)
// .replace(R.id.container, fragment)
// .remove(MikoConnectionStatusFragment.this)
// .commitAllowingStateLoss();
//
// } else if (botResponseModel.getData().getFlag().equalsIgnoreCase("Proceed")) {
// sendCurrentBotPropsEventsMixpanel(ParentalPreferences.getBotId(mActivity));
// setBotListPropsEventsMixpanel(null, prevMikoList, false);
// APIS.getAnaliticsMSG(Constants.event_source, Constants.ALREADY_ASSOCAIATION, Constants.Count, "1");
// Intent intent = new Intent(mActivity, DashboardActivity.class);
// intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
// startActivity(intent);
// }
// }
//
// } else if (botResponseModel.getData().getFlag().equalsIgnoreCase("Occupied")) {
// hideLoader();
// Log.e(TAG, "logout rescan: ");
//
// GenericDialogBuilder genericDialogBuilder = new GenericDialogBuilder.Builder()
// .setShowCloseButton(false)
// .setHeading(mActivity.getResources().getString(R.string.AlreadyLinkedDialogHeading))
// .setDescription(botResponseModel.getMessage())
// .setPositiveButtonText(mActivity.getString(R.string.BotConnectedtoDifferentAccount))
// .setGenericDialogClickListener(this)
// .build();
// showDynamicDialog(genericDialogBuilder);
//
// }
// }
}
}
...
...
@@ -383,9 +214,6 @@ public class MikoConnectionStatusFragment extends BaseFragment implements ICommo
@Override
public
int
getItemViewType
(
int
position
)
{
// if (mDataset.get(position).isHeader) {
// return VIEW_TYPE_HEADER;
// }
return
VIEW_TYPE_WIFFI_NAME
;
}
...
...
@@ -416,8 +244,8 @@ public class MikoConnectionStatusFragment extends BaseFragment implements ICommo
MikoViewHolder
vh2
=
(
MikoViewHolder
)
holder
;
vh2
.
parentWiffiContainer
.
setOnClickListener
(
view
->
{
if
(
Utils
.
getInstance
().
isNetworkAvailable
(
getContext
()))
{
oldBotNo
=
ParentalPreferences
.
getBotId
(
mActivity
);
ParentalPreferences
.
setBotId
(
mActivity
,
botNumber
);
sendCurrentBotPropsEventsMixpanel
(
botNumber
);
JoinUnityCodeFromHere
(
botNumber
);
}
else
{
...
...
@@ -450,35 +278,8 @@ public class MikoConnectionStatusFragment extends BaseFragment implements ICommo
hideLoader
();
ShowGenericDialog
(
Constants
.
NoInternetCase
,
Constants
.
OK
,
mActivity
.
getResources
().
getString
(
R
.
string
.
no_internet_message
),
""
);
}
}
public
void
hideKeyboard
()
{
Utils
.
getInstance
().
hideKeyboard
(
mActivity
);
}
// private void botAssociates() {
//// String bot_name = bleManager.selectedDeviceName;
//// Log.e(TAG, "AAAAAAAAAAAAAAa botAssociates bot selected for BLE"+ bot_name);
//// Log.d(TAG, "onClick: setting BOT it " + bot_name);
//
// String botNumber = ParentalPreferences.getBotId(mActivity);
// String token = ParentalPreferences.getToken(mActivity);
//
// if (Utils.getInstance().isNetworkAvailable(getContext())) {
// Log.d(TAG, "botAssociates: token and mobile number is " + botNumber + " : " + token);
// mPresenter.botAssociates(token, botNumber);
// Log.d(TAG, "botAssociates: called");
// } else {
// hideLoader();
// Log.e(TAG, "hideloader: botAssociates error");
// mPresenter.onError("error");
// ShowGenericDialog(Constants.NoInternetCase, Constants.OK, mActivity.getResources().getString(R.string.no_internet_message), "");
// /* BasicOkDialog(mActivity, getResources().getString(R.string.no_internet_message));*/
// }
// }
@Override
public
void
onClick
(
View
v
)
{
switch
(
v
.
getId
())
{
...
...
@@ -488,10 +289,6 @@ public class MikoConnectionStatusFragment extends BaseFragment implements ICommo
break
;
case
R
.
id
.
txt_logout
:
/*
ViewDialogCustom.customDialog2Btn(mActivity, getResources().getString(R.string.logoutConfirm), Constants.Cancel, Constants.Yes, Constants.ParentalLogout, this);
*/
GenericDialogBuilder
genericDialogBuilder
=
new
GenericDialogBuilder
.
Builder
()
.
setShowCloseButton
(
false
)
.
setHeading
(
mActivity
.
getResources
().
getString
(
R
.
string
.
Logout
))
...
...
@@ -523,22 +320,6 @@ public class MikoConnectionStatusFragment extends BaseFragment implements ICommo
}
}
// public void getAuthID(Context context) {
// try {
// if (Utils.getInstance().isNetworkAvailable(getContext())) {
// if (context != null) {
// if (ParentalPreferences.getMobileNumber(context) != null && ParentalPreferences.getBotId(context) != null && ParentalPreferences.getToken(context) != null) {
// mPresenter.getAuthID(ParentalPreferences.getMobileNumber(context), ParentalPreferences.getToken(context), ParentalPreferences.getBotId(context));
// }
// }
// }
// } catch (Exception e) {
// e.printStackTrace();
// Log.d(TAG, "getAuthID: error in Excuting the fucntion check log" + e.getMessage());
// }
// }
private
void
Logout
(
Context
context
)
{
// setUserID(ParentalPreferences.getMobileNumber(this));
APIS
.
getAnaliticsMSG
(
Constants
.
event_source
,
Constants
.
LOGOUT_SUCCESS
,
Constants
.
Count
,
"1"
);
...
...
@@ -546,20 +327,6 @@ public class MikoConnectionStatusFragment extends BaseFragment implements ICommo
ParentalPreferences
.
clear
(
context
);
Intent
intent
=
new
Intent
(
context
,
InitialActivity
.
class
);
context
.
startActivity
(
intent
);
}
public
void
CallLOgout
()
{
Logout
(
getContext
());
}
private
void
goToFragment
(
Fragment
fragment
)
{
mActivity
.
getSupportFragmentManager
().
beginTransaction
()
.
setCustomAnimations
(
R
.
anim
.
anim_in
,
R
.
anim
.
anim_out
,
R
.
anim
.
anim_in_reverse
,
R
.
anim
.
anim_out_reverse
)
.
replace
(
R
.
id
.
container
,
fragment
)
.
remove
(
MikoConnectionStatusFragment
.
this
)
.
commitAllowingStateLoss
();
}
public
void
ShowGenericDialog
(
int
FunctionNum
,
String
ButtonText
,
String
DialogMessage
,
String
dialogHeading
)
{
...
...
@@ -616,7 +383,6 @@ public class MikoConnectionStatusFragment extends BaseFragment implements ICommo
@Override
public
void
onNegativeButtonClick
(
View
view
,
int
FucntionNumber
)
{
switch
(
FucntionNumber
)
{
//BotConnectedtoDifferentAccount on Logout button
case
901
:
APIS
.
getAnaliticsMSG
(
Constants
.
event_source
,
Constants
.
LOGOUT_SUCCESS
,
Constants
.
Count
,
"1"
);
...
...
@@ -631,7 +397,6 @@ public class MikoConnectionStatusFragment extends BaseFragment implements ICommo
}
public
void
setBotListPropsEventsMixpanel
(
String
botNum
,
ArrayList
<
String
>
prevMikoList
,
Boolean
isViewContent
)
{
if
(
botNum
!=
null
)
{
prevMikoList
.
add
(
botNum
);
}
...
...
This diff is collapsed.
Click to expand it.
app/src/main/res/values/strings.xml
View file @
c774753d
<resources>
<string
name=
"app_name"
>
Miko2
</string>
<string
name=
"app_name"
>
CodeMaster
</string>
<string
name=
"default_app_color"
>
#2196F3
</string>
<string
name=
"no_internet_message"
>
Unable to connect. Please check your internet connection.
</string>
<string
name=
"slow_internet_message_childprofile_onSave"
>
You appear to be offline. Changes may not be saved
</string>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment