mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-06-30 21:04:16 +00:00
add project adins
This commit is contained in:
parent
ad06ac5505
commit
f8f85d679d
5299 changed files with 625430 additions and 0 deletions
|
@ -0,0 +1,65 @@
|
|||
package com.adins.mss.base.todolist.form.todaysplan;
|
||||
|
||||
import android.os.Handler;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.adins.mss.base.GlobalData;
|
||||
import com.adins.mss.base.R;
|
||||
import com.adins.mss.constant.Global;
|
||||
|
||||
|
||||
public class UnplanTaskDummyAdapter extends RecyclerView.Adapter<UnplanTaskDummyAdapter.UnplanTaskDummyViewHolder> {
|
||||
|
||||
View parentView;
|
||||
|
||||
public UnplanTaskDummyAdapter (View parentView){
|
||||
this.parentView = parentView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UnplanTaskDummyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.unplan_task_list_dummy, parent, false);
|
||||
return new UnplanTaskDummyViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull UnplanTaskDummyViewHolder unplanTaskDummyViewHolder, int i) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public class UnplanTaskDummyViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private LinearLayout dummyCollInfo;
|
||||
private LinearLayout addToPlanBtn;
|
||||
|
||||
public UnplanTaskDummyViewHolder(View view) {
|
||||
super(view);
|
||||
addToPlanBtn = parentView.findViewById(R.id.addToPlanBtnCont);
|
||||
dummyCollInfo = view.findViewById(R.id.dummyCollectionInfo);
|
||||
|
||||
if (Global.APPLICATION_COLLECTION.equalsIgnoreCase(GlobalData.getSharedGlobalData().getAuditData().getApplication())) {
|
||||
dummyCollInfo.setVisibility(View.VISIBLE);
|
||||
Handler handler = new Handler();
|
||||
handler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
addToPlanBtn.setVisibility(View.VISIBLE);
|
||||
}
|
||||
},0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,205 @@
|
|||
package com.adins.mss.odr.products.api;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.CountDownTimer;
|
||||
import android.os.Environment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.core.content.FileProvider;
|
||||
import android.util.Base64;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.adins.mss.base.GlobalData;
|
||||
import com.adins.mss.base.util.GsonHelper;
|
||||
import com.adins.mss.constant.Global;
|
||||
import com.adins.mss.dao.Product;
|
||||
import com.adins.mss.foundation.db.dataaccess.ProductDataAccess;
|
||||
import com.adins.mss.foundation.dialog.NiftyDialogBuilder;
|
||||
import com.adins.mss.foundation.formatter.Tool;
|
||||
import com.adins.mss.foundation.http.HttpConnectionResult;
|
||||
import com.adins.mss.foundation.http.HttpCryptedConnection;
|
||||
import com.adins.mss.odr.BuildConfig;
|
||||
import com.adins.mss.odr.R;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class ProductDetailViewPdf extends AsyncTask<Void, Void, String> {
|
||||
|
||||
private FragmentActivity activity;
|
||||
private ProgressDialog progressDialog;
|
||||
private Product product;
|
||||
private String urlFileBrochure;
|
||||
private String errMessage;
|
||||
public static CountDownTimer timer;
|
||||
|
||||
public ProductDetailViewPdf(FragmentActivity activity, Product product) {
|
||||
this.activity = activity;
|
||||
this.product = product;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
super.onPreExecute();
|
||||
progressDialog = ProgressDialog.show(activity, "", activity.getString(R.string.getting_brochure), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String doInBackground(Void... voids) {
|
||||
|
||||
if (Tool.isInternetconnected(activity)) {
|
||||
ProductDetailViewPdfRequest request = new ProductDetailViewPdfRequest();
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("ddMMyyyyHHmmss");
|
||||
String dtmUpd = null;
|
||||
if(product.getProduct_file()!=null && !"".equalsIgnoreCase(product.getProduct_file())){
|
||||
String [] fileName = product.getProduct_file().split("_");
|
||||
if(fileName!=null){
|
||||
if(fileName.length>0){
|
||||
dtmUpd = fileName[fileName.length-1];
|
||||
|
||||
try{
|
||||
dtmUpd = dtmUpd.replace(".pdf", "");
|
||||
Date lastDtmUpd = formatter.parse(dtmUpd);
|
||||
if(lastDtmUpd!=null){
|
||||
request.setDtm_upd(dtmUpd);
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
request.setUuid_product(product.getUuid_product());
|
||||
request.setAudit(GlobalData.getSharedGlobalData().getAuditData());
|
||||
|
||||
String json = GsonHelper.toJson(request);
|
||||
String url = GlobalData.getSharedGlobalData().getURL_GET_PRODUCT_DETAIL();
|
||||
boolean encrypt = GlobalData.getSharedGlobalData().isEncrypt();
|
||||
boolean decrypt = GlobalData.getSharedGlobalData().isDecrypt();
|
||||
HttpCryptedConnection httpConn = new HttpCryptedConnection(activity, encrypt, decrypt);
|
||||
HttpConnectionResult serverResult = null;
|
||||
|
||||
try {
|
||||
serverResult = httpConn.requestToServer(url, json, Global.DEFAULTCONNECTIONTIMEOUT);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (serverResult != null && serverResult.isOK()) {
|
||||
try {
|
||||
String responseBody = serverResult.getResult();
|
||||
ProductDetailViewPdfResponse response = GsonHelper.fromJson(responseBody, ProductDetailViewPdfResponse.class);
|
||||
|
||||
if (response.getStatus().getCode() == 0) {
|
||||
List<ProductDetailViewPdfBean> listProductDetail = response.getListDetailProduct();
|
||||
|
||||
if (listProductDetail != null && !listProductDetail.isEmpty()) {
|
||||
String resultBrochure = listProductDetail.get(0).getProduct_file();
|
||||
Date date = new Date();
|
||||
String dateString = formatter.format(date);
|
||||
GetFilePathAndStatus filepath = getFile(activity.getApplicationContext() ,resultBrochure, "Brosur_" + product.getProduct_name() +"_"+dateString, "pdf");
|
||||
urlFileBrochure = filepath.filePath;
|
||||
product.setProduct_file(urlFileBrochure);
|
||||
ProductDataAccess.addOrReplace(activity, product);
|
||||
} else {
|
||||
errMessage = activity.getString(R.string.no_data_from_server);
|
||||
urlFileBrochure = product.getProduct_file();
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if (Global.IS_DEV) {
|
||||
e.printStackTrace();
|
||||
errMessage = e.getMessage();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
errMessage = activity.getString(R.string.server_down);
|
||||
}
|
||||
} else {
|
||||
errMessage = activity.getString(R.string.no_internet_connection);
|
||||
urlFileBrochure = product.getProduct_file();
|
||||
}
|
||||
return urlFileBrochure;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(final String result) {
|
||||
NiftyDialogBuilder builder = null;
|
||||
super.onPostExecute(result);
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
progressDialog = null;
|
||||
}
|
||||
|
||||
if (errMessage != null) {
|
||||
if (errMessage.equals(activity.getString(R.string.no_data_from_server))) {
|
||||
builder = NiftyDialogBuilder.getInstance(activity);
|
||||
builder.withTitle("INFO").withMessage(errMessage).show();
|
||||
} else {
|
||||
Toast.makeText(activity, errMessage, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
if(result!=null && !"".equalsIgnoreCase(result)){
|
||||
File file = new File(result);
|
||||
if (file.exists()) {
|
||||
if(builder!=null){
|
||||
builder.dismiss();
|
||||
}
|
||||
Uri uri;
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
uri = FileProvider.getUriForFile(activity, BuildConfig.APPLICATION_ID + ".provider", file);
|
||||
} else {
|
||||
uri = Uri.fromFile(file);
|
||||
}
|
||||
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
intent.setDataAndType(uri, "application/pdf");
|
||||
activity.startActivity(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static GetFilePathAndStatus getFile(Context context,String base64, String filename, String extension) {
|
||||
GetFilePathAndStatus getFilePathAndStatus = new GetFilePathAndStatus();
|
||||
|
||||
try( FileOutputStream os = new FileOutputStream(getReportPath(context, filename, extension), false)) {
|
||||
byte[] pdfAsBytes = Base64.decode(base64, 0);
|
||||
os.write(pdfAsBytes);
|
||||
os.flush();
|
||||
getFilePathAndStatus.filStatus = true;
|
||||
getFilePathAndStatus.filePath = getReportPath(context, filename, extension);
|
||||
return getFilePathAndStatus;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
getFilePathAndStatus.filStatus = false;
|
||||
getFilePathAndStatus.filePath = getReportPath(context, filename, extension);
|
||||
return getFilePathAndStatus;
|
||||
}
|
||||
}
|
||||
|
||||
private static String getReportPath(Context context, String filename, String extension) {
|
||||
File file = new File(context.getExternalFilesDir(null), "WFIMOSCS/ProdukBrosur");
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
|
||||
String uriSting = (file.getAbsolutePath() + "/" + filename + "." + extension);
|
||||
return uriSting;
|
||||
}
|
||||
|
||||
private static class GetFilePathAndStatus {
|
||||
public boolean filStatus;
|
||||
public String filePath;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,587 @@
|
|||
package com.adins.mss.base;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.PackageManager.NameNotFoundException;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.core.content.PermissionChecker;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import com.adins.mss.base.commons.Helper;
|
||||
import com.adins.mss.base.commons.ModeledActivity;
|
||||
import com.adins.mss.base.crashlytics.FireCrash;
|
||||
import com.adins.mss.base.dynamictheme.DynamicTheme;
|
||||
import com.adins.mss.base.dynamictheme.ThemeLoader;
|
||||
import com.adins.mss.base.dynamictheme.ThemeUtility;
|
||||
import com.adins.mss.base.login.DefaultLoginModel;
|
||||
import com.adins.mss.base.login.LoginImpl;
|
||||
import com.adins.mss.base.login.LoginModel;
|
||||
import com.adins.mss.base.syncfile.DownloadParams;
|
||||
import com.adins.mss.base.syncfile.FileDownloader;
|
||||
import com.adins.mss.base.syncfile.FileSyncHelper;
|
||||
import com.adins.mss.base.syncfile.ImportDbFromCsv;
|
||||
import com.adins.mss.base.syncfile.ImportDbParams;
|
||||
import com.adins.mss.base.util.LocaleHelper;
|
||||
import com.adins.mss.base.util.Utility;
|
||||
import com.adins.mss.constant.Global;
|
||||
import com.adins.mss.dao.MobileDataFile;
|
||||
import com.adins.mss.foundation.dialog.DialogManager;
|
||||
import com.adins.mss.foundation.location.LocationTrackingManager;
|
||||
import com.adins.mss.foundation.security.storepreferences.ObscuredSharedPreferences;
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||
import com.google.firebase.remoteconfig.FirebaseRemoteConfig;
|
||||
import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings;
|
||||
import com.services.RefreshToken;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.adins.mss.base.login.DefaultLoginModel.LOGIN_PREFERENCES;
|
||||
|
||||
|
||||
/**
|
||||
* Created by Aditya Purwa on 1/6/2015.
|
||||
* Activity for login.
|
||||
*/
|
||||
public abstract class LoginActivity extends AppCompatActivity implements ModeledActivity<DefaultLoginModel> {
|
||||
|
||||
public static Context instance;
|
||||
private List<MobileDataFile> data;
|
||||
public static List<MobileDataFile> activeData;
|
||||
public static int currentidx = 0;
|
||||
public static MobileDataFile metadata;
|
||||
//variable penampung
|
||||
static String link, savePath, message;
|
||||
static ProgressDialog pDialog;
|
||||
private final String DevModeEnable = "$ADIMOBILEDEVMODEON$";
|
||||
private final String DevModeDisable = "$ADIMOBILEDEVMODEOFF$";
|
||||
private final String txtDevModeOn = "ENABLE DEVELOPER MODE";
|
||||
private final String txtDevModeOff = "DISABLE DEVELOPER MODE";
|
||||
private final String txtDevModeOnId = "AKTIFKAN MODE PENGEMBANGAN";
|
||||
private final String txtDevModeOffId = "MATIKAN MODE PENGEMBANGAN";
|
||||
public LocationTrackingManager manager;
|
||||
protected ImageView logo;
|
||||
private LoginModel dataContext;
|
||||
private ObscuredSharedPreferences loginPreferences;
|
||||
//bong 1 apr 15 add menu to serverLinkActivity
|
||||
private Menu mainMenu;
|
||||
private LoginImpl loginImpl;
|
||||
protected ThemeLoader themeLoader;
|
||||
private Toolbar toolbar;
|
||||
private View loginHeader;
|
||||
private Button loginButton;
|
||||
private Fragment locPermissionFragment;
|
||||
protected boolean hasLogged;
|
||||
|
||||
public void downloadFiles() {
|
||||
currentidx++;
|
||||
int i = currentidx;
|
||||
metadata = data.get(i);
|
||||
message = "Downloading file " + (i + 1) + " out of " + data.size() + " files.";
|
||||
link = data.get(i).getFile_url();
|
||||
savePath = GlobalData.getSharedGlobalData().getSavePath();
|
||||
if (link != null && !link.isEmpty()) {
|
||||
DownloadParams parameters = new DownloadParams(savePath, instance, message, metadata);
|
||||
FileDownloader downloader = new FileDownloader(instance);
|
||||
downloader.execute(parameters);
|
||||
}
|
||||
}
|
||||
|
||||
public static void importFiles() {
|
||||
currentidx++;
|
||||
int i = currentidx;
|
||||
metadata = activeData.get(i);
|
||||
message = "Importing file " + (i + 1) + " out of " + activeData.size() + " files.";
|
||||
ImportDbParams importParams = new ImportDbParams(instance, message, metadata);
|
||||
ImportDbFromCsv importer = new ImportDbFromCsv();
|
||||
importer.execute(importParams);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
MenuInflater inflater = getMenuInflater();
|
||||
inflater.inflate(R.menu.menu_item, menu);
|
||||
|
||||
mainMenu = menu;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||
Global.IS_DEV = false;
|
||||
enableMenuItem(false);
|
||||
if (Global.IS_DEV) {
|
||||
enableMenuItem(true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void enableMenuItem(boolean enable) {
|
||||
if (enable) {
|
||||
mainMenu.findItem(R.id.menuItem).setVisible(true);
|
||||
mainMenu.findItem(R.id.serverLink).setVisible(true);
|
||||
mainMenu.findItem(R.id.devOption).setVisible(true);
|
||||
} else {
|
||||
mainMenu.findItem(R.id.menuItem).setVisible(false);
|
||||
mainMenu.findItem(R.id.serverLink).setVisible(false);
|
||||
mainMenu.findItem(R.id.devOption).setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||
if (event.getAction() == KeyEvent.ACTION_UP && KeyEvent.KEYCODE_MENU == keyCode) {
|
||||
if(Global.IS_DEV)
|
||||
mainMenu.performIdentifierAction(R.id.menuItem, 0);
|
||||
return true;
|
||||
}
|
||||
return super.onKeyUp(keyCode, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
String title = item.getTitle().toString();
|
||||
if (getString(R.string.lblServerLinkId).equals(title)) {
|
||||
startActivity(new Intent(LoginActivity.this, ServerLinkActivity.class));
|
||||
}
|
||||
if (getString(R.string.lblDevOption).equals(title)) {
|
||||
startActivity(new Intent(LoginActivity.this, DeveloperOptionActivity.class));
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
//delete downloaded update file
|
||||
File file = new File(getApplicationContext().getFilesDir(), "app.apk");
|
||||
if(file.exists()) {
|
||||
boolean result = file.delete();
|
||||
if(!result){
|
||||
Toast.makeText(this, "Cannot delete downloaded update file", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
if(hasLogged && GlobalData.getSharedGlobalData().getUser() != null)
|
||||
return;//dipatch if has logged
|
||||
|
||||
|
||||
LocaleHelper.onCreate(getApplicationContext());
|
||||
setContentView(R.layout.new_login_activity);
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O) {
|
||||
getWindow().getDecorView().setImportantForAutofill(
|
||||
View.IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS);
|
||||
}
|
||||
logo = (ImageView) findViewById(R.id.logoMobile);
|
||||
loginHeader = findViewById(R.id.loginHeader);
|
||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
toolbar.setTitle("");
|
||||
setSupportActionBar(toolbar);
|
||||
loginImpl = new LoginImpl(this);
|
||||
initialize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
//Check location permission whether to show educational UI about permission or not
|
||||
if (Global.ENABLE_LOC_PERMISSION_UI) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_DENIED &&
|
||||
checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_DENIED) {
|
||||
showLocationPermissionInformativeUI();
|
||||
} else {
|
||||
Utility.checkPermissionGranted(LoginActivity.this);
|
||||
}
|
||||
} else {
|
||||
if (PermissionChecker.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PermissionChecker.PERMISSION_DENIED &&
|
||||
PermissionChecker.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PermissionChecker.PERMISSION_DENIED) {
|
||||
showLocationPermissionInformativeUI();
|
||||
} else {
|
||||
Utility.checkPermissionGranted(LoginActivity.this);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Utility.checkPermissionGranted(LoginActivity.this);
|
||||
}
|
||||
|
||||
ObscuredSharedPreferences sharedPreferences = ObscuredSharedPreferences.getPrefs(this,
|
||||
LOGIN_PREFERENCES, Context.MODE_PRIVATE);
|
||||
if (sharedPreferences.contains("is_expired") && sharedPreferences.getBoolean("is_expired", false)) {
|
||||
sharedPreferences.edit().putBoolean("is_expired", false).apply();
|
||||
FileSyncHelper.senderID = 0;
|
||||
FileSyncHelper.startFileSync(this);
|
||||
return;
|
||||
}
|
||||
|
||||
if (null != loginImpl) { // Penjagaan ketika masuk kembali ke APP (kejadian null saat di collection)
|
||||
if (loginImpl.isRooted()) {
|
||||
DialogManager.showRootAlert(this, getApplicationContext());
|
||||
}
|
||||
|
||||
if (loginImpl.checkPlayServices(this)) {
|
||||
// Then we're good to go!
|
||||
}
|
||||
}
|
||||
|
||||
DialogManager.showTimeProviderAlert(this);
|
||||
|
||||
if (Helper.isDevEnabled(this) && GlobalData.getSharedGlobalData().isDevEnabled() && !GlobalData.getSharedGlobalData().isByPassDeveloper()) {
|
||||
DialogManager.showTurnOffDevMode(this);
|
||||
}
|
||||
|
||||
if(hasLogged)
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
//prevent from activity destroyed before dialog closed
|
||||
if(dataContext != null){
|
||||
DefaultLoginModel defaultLoginModel = (DefaultLoginModel)dataContext;
|
||||
defaultLoginModel.closeProgress();
|
||||
}
|
||||
|
||||
if(hasLogged)
|
||||
return;
|
||||
|
||||
if (loginImpl.getLocationManager() != null) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||
return;
|
||||
} else {
|
||||
loginImpl.removeUpdateLocation();
|
||||
}
|
||||
} else {
|
||||
loginImpl.removeUpdateLocation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context newBase) {
|
||||
Context context = newBase;
|
||||
Locale locale;
|
||||
try{
|
||||
locale = new Locale(LocaleHelper.getLanguage(newBase));
|
||||
context = LocaleHelper.wrap(newBase, locale);
|
||||
} catch (Exception e) {
|
||||
locale = new Locale(Locale.getDefault().getLanguage());
|
||||
context = LocaleHelper.wrap(newBase, locale);
|
||||
} finally {
|
||||
super.attachBaseContext(context);
|
||||
}
|
||||
}
|
||||
|
||||
private void initialize() {
|
||||
PackageInfo pInfo;
|
||||
try {
|
||||
new RefreshToken(getBaseContext()).onTokenRefresh();
|
||||
} catch (Exception e){
|
||||
FireCrash.log(e);
|
||||
}
|
||||
try {
|
||||
pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
|
||||
Global.APP_VERSION = pInfo.versionName;
|
||||
Global.BUILD_VERSION = pInfo.versionCode;
|
||||
|
||||
} catch (NameNotFoundException e) {
|
||||
if (Global.IS_DEV)
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
TextView tvAppVersion = (TextView) findViewById(R.id.contentVersion);
|
||||
String versioning = getString(R.string.app_name) + " v." + Global.APP_VERSION;
|
||||
tvAppVersion.setText(versioning);
|
||||
|
||||
loginImpl.initializePreferences();
|
||||
loginPreferences = loginImpl.getLoginPreferences();
|
||||
|
||||
setModel(getNewDefaultLoginModel(this));
|
||||
attachEventListener();
|
||||
|
||||
String language = LocaleHelper.getLanguage(this);
|
||||
LocaleHelper.setLocale(this,language);
|
||||
|
||||
TextView androidId = (TextView) findViewById(R.id.androidId);
|
||||
TextView divider = (TextView) findViewById(R.id.divider);
|
||||
final String android_id;
|
||||
if(Build.VERSION.SDK_INT > 28){
|
||||
android_id = Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID);
|
||||
androidId.setVisibility(View.VISIBLE);
|
||||
divider.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
android_id = "";
|
||||
androidId.setVisibility(View.GONE);
|
||||
divider.setVisibility(View.GONE);
|
||||
}
|
||||
androidId.setText(android_id);
|
||||
androidId.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
ClipData clip = ClipData.newPlainText("Clip", android_id);
|
||||
clipboard.setPrimaryClip(clip);
|
||||
Toast.makeText(getApplicationContext(),getString(R.string.copied),Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected abstract DefaultLoginModel getNewDefaultLoginModel(Context context);
|
||||
|
||||
private void attachEventListener() {
|
||||
loginButton = (Button) findViewById(R.id.btnLogin);
|
||||
final CheckBox checkRememberMe = (CheckBox) findViewById(R.id.checkRememberMe);
|
||||
final EditText editUserId = (EditText) findViewById(R.id.txtUser);
|
||||
final EditText editPassword = (EditText) findViewById(R.id.txtPassword);
|
||||
|
||||
editUserId.setText(loginPreferences.getString(DefaultLoginModel.LOGIN_PREFERENCES_USERNAME, getString(R.string.txtempty)));
|
||||
editPassword.setText(loginPreferences.getString(DefaultLoginModel.LOGIN_PREFERENCES_PASSWORD, getString(R.string.txtempty)));
|
||||
checkRememberMe.setChecked(loginPreferences.getBoolean(DefaultLoginModel.LOGIN_PREFERENCES_REMEMBER_ME, false));
|
||||
if (checkRememberMe.isChecked()) {
|
||||
getModel().setRememberMe(true);
|
||||
}
|
||||
getModel().setUsername(editUserId.getText().toString());
|
||||
getModel().setPassword(editPassword.getText().toString());
|
||||
|
||||
loginButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (loginButton.getText().equals(txtDevModeOn) || loginButton.getText().equals(txtDevModeOnId)) {
|
||||
ObscuredSharedPreferences.Editor sharedPrefEditor = loginImpl.getSharedPref().edit();
|
||||
sharedPrefEditor.putBoolean("IS_DEV", true);
|
||||
sharedPrefEditor.commit();
|
||||
Global.IS_DEV = true;
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
enableMenuItem(true);
|
||||
editPassword.setText("");
|
||||
}
|
||||
});
|
||||
} else if (loginButton.getText().equals(txtDevModeOff) || loginButton.getText().equals(txtDevModeOffId)) {
|
||||
ObscuredSharedPreferences.Editor sharedPrefEditor = loginImpl.getSharedPref().edit();
|
||||
sharedPrefEditor.putBoolean("IS_DEV", false);
|
||||
sharedPrefEditor.commit();
|
||||
Global.IS_DEV = false;
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
enableMenuItem(false);
|
||||
editPassword.setText("");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
getModel().login();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
editUserId.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
//EMPTY
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
getModel().setUsername(s.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
//EMPTY
|
||||
}
|
||||
});
|
||||
|
||||
editPassword.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
//EMPTY
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
getModel().setPassword(s.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
String devMode = editPassword.getText().toString().trim();
|
||||
if (devMode != null && devMode.length() > 0 && devMode.equals(DevModeEnable) && loginImpl.isCan_access_developer_mode()) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
loginButton.setText(getString(R.string.enableDevMode));
|
||||
}
|
||||
});
|
||||
} else if (devMode != null && devMode.length() > 0 && devMode.equals(DevModeDisable)) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
loginButton.setText(getString(R.string.disableDevMode));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
loginButton.setText(getString(R.string.btnLogin));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
checkRememberMe.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
getModel().setRememberMe(isChecked);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public DefaultLoginModel getModel() {
|
||||
return (DefaultLoginModel) dataContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setModel(DefaultLoginModel model) {
|
||||
dataContext = model;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
switch (requestCode) {
|
||||
case Utility.REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS: {
|
||||
if (Utility.checkPermissionResult(LoginActivity.this, permissions, grantResults)) {
|
||||
loginImpl.bindLocationListener();
|
||||
if (Global.ENABLE_LOC_PERMISSION_UI) {
|
||||
getSupportFragmentManager().popBackStack();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int color;
|
||||
protected void applyColorTheme(DynamicTheme dynamicTheme){//apply color set to views
|
||||
String commonBgColor = ThemeUtility.getColorItemValue(dynamicTheme,"bg_solid");
|
||||
String btnNormalColor = ThemeUtility.getColorItemValue(dynamicTheme,"btn_bg_normal");
|
||||
String btnPressedColor = ThemeUtility.getColorItemValue(dynamicTheme,"btn_bg_pressed");
|
||||
color = Color.parseColor(commonBgColor);
|
||||
ThemeUtility.setToolbarColor(toolbar,color);
|
||||
ThemeUtility.setStatusBarColor(this,color);
|
||||
ThemeUtility.setViewBackground(loginHeader,color);
|
||||
ThemeUtility.setViewBackground(loginButton,color);
|
||||
|
||||
//create color state list for button states
|
||||
int[][] btnstates = new int[][] {
|
||||
new int[] { android.R.attr.state_pressed}, // pressed
|
||||
new int[] {} // normal
|
||||
};
|
||||
|
||||
int[] btncolorlist = new int[]{
|
||||
Color.parseColor(btnPressedColor),
|
||||
Color.parseColor(btnNormalColor)
|
||||
};
|
||||
ColorStateList btnColorStateList = new ColorStateList(btnstates,btncolorlist);
|
||||
ThemeUtility.setViewBackground(loginButton,btnColorStateList);
|
||||
}
|
||||
|
||||
protected void fetchConfig() {
|
||||
final FirebaseRemoteConfig remoteConfig = FirebaseRemoteConfig.getInstance();
|
||||
FirebaseRemoteConfigSettings remoteConfigSettings = new FirebaseRemoteConfigSettings.Builder()
|
||||
.build();
|
||||
|
||||
defaultConfig = new HashMap<>();
|
||||
defaultConfig.put("cipher_unsupported_device", Global.SQLITE_CIPHER_UNSUPPORTED);
|
||||
|
||||
remoteConfig.setConfigSettingsAsync(remoteConfigSettings);
|
||||
remoteConfig.setDefaultsAsync(defaultConfig);
|
||||
remoteConfig.fetch().addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
if (!task.isComplete() && !task.isSuccessful())
|
||||
return;
|
||||
|
||||
remoteConfig.activate();
|
||||
GlobalData.getSharedGlobalData().setRemoteConfig(remoteConfig);
|
||||
|
||||
String sqliteCipherException = remoteConfig.getString("cipher_unsupported_device");
|
||||
Global.IS_DBENCRYPT = (!sqliteCipherException.contains(Build.MODEL)) && Global.IS_DBENCRYPT;
|
||||
}
|
||||
});
|
||||
|
||||
GlobalData.getSharedGlobalData().setRemoteConfig(remoteConfig);
|
||||
}
|
||||
|
||||
public void showLocationPermissionInformativeUI(){
|
||||
locPermissionFragment = new LocationPermissionInformationFragment();
|
||||
getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.login_activity,locPermissionFragment)
|
||||
.addToBackStack(null)
|
||||
.commit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (Global.ENABLE_LOC_PERMISSION_UI && null != locPermissionFragment && locPermissionFragment.isVisible()) {
|
||||
Toast.makeText(this ,R.string.allow_all_permission, Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, Object> defaultConfig;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,274 @@
|
|||
package com.github.jjobes.slidedatetimepicker;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>This class contains methods for the library client to create
|
||||
* a new {@code SlideDateTimePicker}.</p>
|
||||
* <p>
|
||||
* <p>It also implements a Builder API that offers more convenient
|
||||
* object creation.</p>
|
||||
*
|
||||
* @author jjobes
|
||||
*/
|
||||
public class SlideDateTimePicker {
|
||||
public static final int HOLO_DARK = 1;
|
||||
public static final int HOLO_LIGHT = 2;
|
||||
|
||||
private FragmentManager mFragmentManager;
|
||||
private SlideDateTimeListener mListener;
|
||||
private Date mInitialDate;
|
||||
private Date mMinDate;
|
||||
private Date mMaxDate;
|
||||
private boolean mIsClientSpecified24HourTime;
|
||||
private boolean mIs24HourTime;
|
||||
private int mTheme;
|
||||
private int mIndicatorColor;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@code SlideDateTimePicker}.
|
||||
*
|
||||
* @param fm The {@code FragmentManager} from the calling activity that is used
|
||||
* internally to show the {@code DialogFragment}.
|
||||
*/
|
||||
public SlideDateTimePicker(FragmentManager fm) {
|
||||
// See if there are any DialogFragments from the FragmentManager
|
||||
FragmentTransaction ft = fm.beginTransaction();
|
||||
Fragment prev = fm.findFragmentByTag(SlideDateTimeDialogFragment.TAG_SLIDE_DATE_TIME_DIALOG_FRAGMENT);
|
||||
|
||||
// Remove if found
|
||||
if (prev != null) {
|
||||
ft.remove(prev);
|
||||
ft.commit();
|
||||
}
|
||||
|
||||
mFragmentManager = fm;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Sets the listener that is used to inform the client when
|
||||
* the user selects a new date and time.</p>
|
||||
* <p>
|
||||
* <p>This must be called before {@link #show()}.</p>
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
public void setListener(SlideDateTimeListener listener) {
|
||||
mListener = listener;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Sets the initial date and time to display in the date
|
||||
* and time pickers.</p>
|
||||
* <p>
|
||||
* <p>If this method is not called, the current date and time
|
||||
* will be displayed.</p>
|
||||
*
|
||||
* @param initialDate the {@code Date} object used to determine the
|
||||
* initial date and time to display
|
||||
*/
|
||||
public void setInitialDate(Date initialDate) {
|
||||
mInitialDate = initialDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Sets the minimum date that the DatePicker should show.</p>
|
||||
* <p>
|
||||
* <p>This must be called before {@link #show()}.</p>
|
||||
*
|
||||
* @param minDate the minimum selectable date for the DatePicker
|
||||
*/
|
||||
public void setMinDate(Date minDate) {
|
||||
mMinDate = minDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Sets the maximum date that the DatePicker should show.</p>
|
||||
* <p>
|
||||
* <p>This must be called before {@link #show()}.</p>
|
||||
*
|
||||
* @param maxDate the maximum selectable date for the DatePicker
|
||||
*/
|
||||
public void setMaxDate(Date maxDate) {
|
||||
mMaxDate = maxDate;
|
||||
}
|
||||
|
||||
private void setIsClientSpecified24HourTime(boolean isClientSpecified24HourTime) {
|
||||
mIsClientSpecified24HourTime = isClientSpecified24HourTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Sets whether the TimePicker displays its time in 12-hour
|
||||
* (AM/PM) or 24-hour format.</p>
|
||||
* <p>
|
||||
* <p>If this method is not called, the device's default time
|
||||
* format is used.</p>
|
||||
* <p>
|
||||
* <p>This also affects the time displayed in the tab.</p>
|
||||
* <p>
|
||||
* <p>Must be called before {@link #show()}.</p>
|
||||
*
|
||||
* @param is24HourTime <tt>true</tt> to force 24-hour time format,
|
||||
* <tt>false</tt> to force 12-hour (AM/PM) time
|
||||
* format.
|
||||
*/
|
||||
public void setIs24HourTime(boolean is24HourTime) {
|
||||
setIsClientSpecified24HourTime(true);
|
||||
mIs24HourTime = is24HourTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the theme of the dialog. If no theme is specified, it
|
||||
* defaults to holo light.
|
||||
*
|
||||
* @param theme {@code SlideDateTimePicker.HOLO_DARK} for a dark theme, or
|
||||
* {@code SlideDateTimePicker.HOLO_LIGHT} for a light theme
|
||||
*/
|
||||
public void setTheme(int theme) {
|
||||
mTheme = theme;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the color of the underline for the currently selected tab.
|
||||
*
|
||||
* @param indicatorColor the color of the selected tab's underline
|
||||
*/
|
||||
public void setIndicatorColor(int indicatorColor) {
|
||||
mIndicatorColor = indicatorColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the dialog to the user. Make sure to call
|
||||
* {@link #setListener()} before calling this.
|
||||
*/
|
||||
public void show() {
|
||||
if (mListener == null) {
|
||||
throw new NullPointerException(
|
||||
"Attempting to bind null listener to SlideDateTimePicker");
|
||||
}
|
||||
|
||||
if (mInitialDate == null) {
|
||||
setInitialDate(new Date());
|
||||
}
|
||||
|
||||
SlideDateTimeDialogFragment dialogFragment =
|
||||
SlideDateTimeDialogFragment.newInstance(
|
||||
mListener,
|
||||
mInitialDate,
|
||||
mMinDate,
|
||||
mMaxDate,
|
||||
mIsClientSpecified24HourTime,
|
||||
mIs24HourTime,
|
||||
mTheme,
|
||||
mIndicatorColor);
|
||||
|
||||
dialogFragment.show(mFragmentManager,
|
||||
SlideDateTimeDialogFragment.TAG_SLIDE_DATE_TIME_DIALOG_FRAGMENT);
|
||||
}
|
||||
|
||||
/*
|
||||
* The following implements the builder API to simplify
|
||||
* creation and display of the dialog.
|
||||
*/
|
||||
public static class Builder {
|
||||
// Required
|
||||
private FragmentManager fm;
|
||||
private SlideDateTimeListener listener;
|
||||
|
||||
// Optional
|
||||
private Date initialDate;
|
||||
private Date minDate;
|
||||
private Date maxDate;
|
||||
private boolean isClientSpecified24HourTime;
|
||||
private boolean is24HourTime;
|
||||
private int theme;
|
||||
private int indicatorColor;
|
||||
|
||||
public Builder(FragmentManager fm) {
|
||||
this.fm = fm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SlideDateTimePicker#setListener(SlideDateTimeListener)
|
||||
*/
|
||||
public Builder setListener(SlideDateTimeListener listener) {
|
||||
this.listener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SlideDateTimePicker#setInitialDate(Date)
|
||||
*/
|
||||
public Builder setInitialDate(Date initialDate) {
|
||||
this.initialDate = initialDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SlideDateTimePicker#setMinDate(Date)
|
||||
*/
|
||||
public Builder setMinDate(Date minDate) {
|
||||
this.minDate = minDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SlideDateTimePicker#setMaxDate(Date)
|
||||
*/
|
||||
public Builder setMaxDate(Date maxDate) {
|
||||
this.maxDate = maxDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SlideDateTimePicker#setIs24HourTime(boolean)
|
||||
*/
|
||||
public Builder setIs24HourTime(boolean is24HourTime) {
|
||||
this.isClientSpecified24HourTime = true;
|
||||
this.is24HourTime = is24HourTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SlideDateTimePicker#setTheme(int)
|
||||
*/
|
||||
public Builder setTheme(int theme) {
|
||||
this.theme = theme;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SlideDateTimePicker#setIndicatorColor(int)
|
||||
*/
|
||||
public Builder setIndicatorColor(int indicatorColor) {
|
||||
this.indicatorColor = indicatorColor;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Build and return a {@code SlideDateTimePicker} object based on the previously
|
||||
* supplied parameters.</p>
|
||||
* <p>
|
||||
* <p>You should call {@link #show()} immediately after this.</p>
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public SlideDateTimePicker build() {
|
||||
SlideDateTimePicker picker = new SlideDateTimePicker(fm);
|
||||
picker.setListener(listener);
|
||||
picker.setInitialDate(initialDate);
|
||||
picker.setMinDate(minDate);
|
||||
picker.setMaxDate(maxDate);
|
||||
picker.setIsClientSpecified24HourTime(isClientSpecified24HourTime);
|
||||
picker.setIs24HourTime(is24HourTime);
|
||||
picker.setTheme(theme);
|
||||
picker.setIndicatorColor(indicatorColor);
|
||||
|
||||
return picker;
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 8.7 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:padding="10dp"
|
||||
android:textSize="20sp"
|
||||
|
||||
android:textColor="#0b5d66"/>
|
Loading…
Add table
Add a link
Reference in a new issue