Modifiche varie
This commit is contained in:
parent
3683062370
commit
3a8e475f72
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -24,7 +24,7 @@
|
||||
</value>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
|
||||
|
||||
android {
|
||||
compileSdkVersion 27
|
||||
buildToolsVersion '27.0.3'
|
||||
buildToolsVersion '28.0.3'
|
||||
defaultConfig {
|
||||
applicationId "it.integry.integrywmsnative"
|
||||
minSdkVersion 21
|
||||
@ -22,6 +22,10 @@ android {
|
||||
enabled = true
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
targetCompatibility 1.8
|
||||
sourceCompatibility 1.8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@ -32,13 +36,16 @@ dependencies {
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
|
||||
implementation 'com.orhanobut:logger:2.2.0'
|
||||
|
||||
|
||||
implementation 'com.android.support:appcompat-v7:27.1.1'
|
||||
implementation 'com.android.support:support-v4:27.1.1'
|
||||
implementation 'com.android.support:design:27.1.1'
|
||||
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
|
||||
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
|
||||
implementation 'com.android.support:cardview-v7:27.1.1'
|
||||
implementation 'com.android.support:recyclerview-v7:27.1.1'
|
||||
implementation 'com.android.support:preference-v7:27.1.1'
|
||||
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.0.0'
|
||||
@ -46,8 +53,6 @@ dependencies {
|
||||
implementation 'org.parceler:parceler-api:1.1.10'
|
||||
annotationProcessor 'org.parceler:parceler:1.1.10'
|
||||
|
||||
|
||||
|
||||
//MVVM
|
||||
implementation "android.arch.lifecycle:extensions:1.1.1"
|
||||
annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
|
||||
@ -61,6 +66,7 @@ dependencies {
|
||||
implementation 'com.jakewharton:butterknife:8.8.1'
|
||||
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
|
||||
|
||||
implementation 'br.com.zbra:android-linq:1.1.0'
|
||||
|
||||
//FAB
|
||||
//implementation 'com.getbase:floatingactionbutton:1.10.1'
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
package it.integry.integrywmsnative;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
@ -13,32 +11,26 @@ import android.support.v7.app.ActionBarDrawerToggle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.SearchView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.text.SpannableString;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
||||
import net.cachapa.expandablelayout.ExpandableLayout;
|
||||
|
||||
import org.xml.sax.ErrorHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISimpleOperationCallback;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISingleValueOperationCallback;
|
||||
import it.integry.integrywmsnative.core.REST.watcher.ServerStatusChecker;
|
||||
import it.integry.integrywmsnative.core.exception.ExceptionsHandler;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilitySettings;
|
||||
import it.integry.integrywmsnative.core.wifi.WiFiCheckerViewHolder;
|
||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneFragment;
|
||||
import it.integry.integrywmsnative.gest.accettazione.core.interfaces.ITitledFragment;
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.AccettazioneOrdineInevasoActivity;
|
||||
import it.integry.integrywmsnative.gest.login.LoginActivity;
|
||||
import it.integry.integrywmsnative.gest.main.MainFragment;
|
||||
import it.integry.integrywmsnative.gest.settings.MainSettingsFragment;
|
||||
import it.integry.integrywmsnative.gest.settings.SettingsPreferenceFragment;
|
||||
|
||||
public class MainActivity extends AppCompatActivity
|
||||
implements NavigationView.OnNavigationItemSelectedListener {
|
||||
@ -47,11 +39,12 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
@BindView(R.id.nav_view) NavigationView mNavigationView;
|
||||
|
||||
@BindView(R.id.no_connection_top_layout)
|
||||
ExpandableLayout mNoConnectionLayout;
|
||||
|
||||
private ServerStatusChecker serverStatusChecker;
|
||||
|
||||
|
||||
|
||||
private boolean firstCheckExecution = true;
|
||||
private boolean mIsOnline = false;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@ -79,7 +72,10 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
mSearchView.setVisibility(View.GONE);
|
||||
|
||||
changeContentFragment(MainFragment.newInstance());
|
||||
|
||||
init();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -91,54 +87,6 @@ public class MainActivity extends AppCompatActivity
|
||||
this.finish();
|
||||
}
|
||||
|
||||
private void init(){
|
||||
serverStatusChecker = new ServerStatusChecker();
|
||||
serverStatusChecker.startMonitoring(new ISingleValueOperationCallback<Boolean>() {
|
||||
@Override
|
||||
public void onResult(Boolean value) {
|
||||
if(value && (mNoConnectionLayout.isExpanded() || firstCheckExecution)){
|
||||
|
||||
SettingsManager.reloadDBVariables(new ISimpleOperationCallback() {
|
||||
@Override
|
||||
public void onSuccess(Object value) {
|
||||
collapseNoConnectionLayout();
|
||||
firstCheckExecution = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
//mNoConnectionLayout.expand(true);
|
||||
if(!mNoConnectionLayout.isExpanded()) expandNoConnectionLayout();
|
||||
}
|
||||
});
|
||||
|
||||
} else if(!value && !mNoConnectionLayout.isExpanded()){
|
||||
expandNoConnectionLayout();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
WiFiCheckerViewHolder wiFiCheckerViewHolder = new WiFiCheckerViewHolder(this, R.id.wifi_power);
|
||||
wiFiCheckerViewHolder.startMonitoring();
|
||||
}
|
||||
|
||||
private void collapseNoConnectionLayout(){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mNoConnectionLayout.collapse(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void expandNoConnectionLayout(){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mNoConnectionLayout.expand(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@ -196,17 +144,17 @@ public class MainActivity extends AppCompatActivity
|
||||
}
|
||||
|
||||
|
||||
else if(id == R.id.nav_settings){
|
||||
fragment = new MainSettingsFragment();
|
||||
this.adaptViewToFragment(fragment);
|
||||
}
|
||||
|
||||
else if(id == R.id.nav_logout){
|
||||
UtilitySettings.logout();
|
||||
startLoginActivity();
|
||||
}
|
||||
|
||||
if (fragment != null) {
|
||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
fragmentManager.beginTransaction()
|
||||
.replace(R.id.frame_container, fragment).commit();
|
||||
|
||||
}
|
||||
changeContentFragment(fragment);
|
||||
|
||||
DrawerLayout drawer = findViewById(R.id.drawer_layout);
|
||||
drawer.closeDrawer(GravityCompat.START);
|
||||
@ -229,4 +177,44 @@ public class MainActivity extends AppCompatActivity
|
||||
getSupportActionBar().setTitle(R.string.app_name);
|
||||
}
|
||||
}
|
||||
|
||||
private void changeContentFragment(Fragment fragment){
|
||||
if (fragment != null) {
|
||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
fragmentManager.beginTransaction()
|
||||
.replace(R.id.frame_container, fragment).commit();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void init(){
|
||||
ServerStatusChecker.getIstance().addCallback(value -> {
|
||||
if(value && (!mIsOnline || firstCheckExecution)){
|
||||
|
||||
SettingsManager.reloadDBVariables(new ISimpleOperationCallback() {
|
||||
@Override
|
||||
public void onSuccess(Object value) {
|
||||
mIsOnline = true;
|
||||
firstCheckExecution = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
//mNoConnectionLayout.expand(true);
|
||||
if(!mIsOnline) mIsOnline = false;
|
||||
}
|
||||
});
|
||||
|
||||
} else if(!value && mIsOnline){
|
||||
mIsOnline = false;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -6,6 +6,10 @@ import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.text.SpannableString;
|
||||
|
||||
import com.orhanobut.logger.AndroidLogAdapter;
|
||||
import com.orhanobut.logger.Logger;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.watcher.ServerStatusChecker;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.settings.Stash;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogSimpleMessageHelper;
|
||||
@ -23,6 +27,9 @@ public class MainApplication extends Application {
|
||||
Stash.init(this);
|
||||
|
||||
SettingsManager.init(this);
|
||||
ServerStatusChecker.init();
|
||||
|
||||
Logger.addLogAdapter(new AndroidLogAdapter());
|
||||
|
||||
res = getResources();
|
||||
Context = this;
|
||||
|
||||
@ -1,7 +1,16 @@
|
||||
package it.integry.integrywmsnative.core.REST;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import java.net.SocketException;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISimpleOperationCallback;
|
||||
import it.integry.integrywmsnative.core.REST.model.EsitoType;
|
||||
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import retrofit2.Response;
|
||||
|
||||
/**
|
||||
* Created by GiuseppeS on 22/03/2018.
|
||||
@ -9,6 +18,7 @@ import java.net.SocketTimeoutException;
|
||||
|
||||
public class CommonRESTException {
|
||||
|
||||
|
||||
public static String tryRecognizeThenGetMessage(Exception ex){
|
||||
|
||||
if(ex instanceof SocketException){
|
||||
|
||||
@ -32,7 +32,7 @@ public class EntityRESTConsumer {
|
||||
Gson gson = new Gson();
|
||||
//Type fooType = new TypeToken<T>() {}.getType();
|
||||
String json = gson.toJson(response.body().getEntity());
|
||||
callback.onSuccess((T) gson.fromJson(json, clazzType));
|
||||
callback.onSuccess(gson.fromJson(json, clazzType));
|
||||
} else {
|
||||
Log.e("EntityRESTConsumer", response.body().getErrorMessage());
|
||||
callback.onFailed(new Exception(response.body().getErrorMessage()));
|
||||
|
||||
@ -0,0 +1,62 @@
|
||||
package it.integry.integrywmsnative.core.REST.consumers;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.CommonRESTException;
|
||||
import it.integry.integrywmsnative.core.REST.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.REST.model.EsitoType;
|
||||
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
|
||||
public static void getAvailablePrinters(final ISimpleOperationCallback<List<String>> callback) {
|
||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||
printerService.getAvailablePrinters().enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
||||
analyzeAnswer(response, "GetAvailablePrinters", callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<List<String>>> call, Throwable t) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void printCollo(String printerName, MtbColt testataColloToPrint, int quantity, String reportName, final ISimpleOperationCallback<Object> callback) {
|
||||
|
||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||
printerService.printCollo(
|
||||
printerName,
|
||||
testataColloToPrint.getDataColloS(),
|
||||
testataColloToPrint.getGestione(),
|
||||
testataColloToPrint.getSerCollo(),
|
||||
testataColloToPrint.getNumCollo(),
|
||||
quantity,
|
||||
reportName)
|
||||
|
||||
.enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||
analyzeAnswer(response, "PrintCollo", callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||
Log.e("PrintCollo", t.toString());
|
||||
callback.onFailed(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package it.integry.integrywmsnative.core.REST.consumers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.model.AvailableCodMdepsDTO;
|
||||
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface PrinterRESTConsumerService {
|
||||
|
||||
@POST("getAvailablePrinters")
|
||||
Call<ServiceRESTResponse<List<String>>> getAvailablePrinters();
|
||||
|
||||
|
||||
@POST("pkgPrintLabel")
|
||||
Call<ServiceRESTResponse<Object>> printCollo(
|
||||
@Query("printerName") String printerName,
|
||||
@Query("dataCollo") String dataCollo,
|
||||
@Query("gestione") String gestione,
|
||||
@Query("serCollo") String serCollo,
|
||||
@Query("numCollo") int numCollo,
|
||||
@Query("printQuantity") int printQuantity,
|
||||
@Query("reportName") String reportName
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
@ -13,7 +13,7 @@ import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
public class SystemRESTConsumer {
|
||||
public class SystemRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public static void getAvailableProfiles(final ISimpleOperationCallback<List<String>> callback){
|
||||
|
||||
@ -21,36 +21,13 @@ public class SystemRESTConsumer {
|
||||
service.getAvailableProfiles(SettingsManager.i().user.username, SettingsManager.i().user.password).enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
||||
|
||||
if(response.isSuccessful()) {
|
||||
|
||||
if(response.body() != null) {
|
||||
if(response.body().getEsito() == EsitoType.OK) {
|
||||
callback.onSuccess(response.body().getDto());
|
||||
} else {
|
||||
Log.e("ProfilesAvailable", response.body().getErrorMessage());
|
||||
callback.onFailed(new Exception(response.body().getErrorMessage()));
|
||||
}
|
||||
} else {
|
||||
Log.e("ProfilesAvailable", response.message());
|
||||
callback.onFailed(new Exception(response.message()));
|
||||
}
|
||||
} else {
|
||||
Log.e("ProfilesAvailable", "Status " + response.code() + ": " + response.message());
|
||||
callback.onFailed(new Exception("Status " + response.code() + ": " + response.message()));
|
||||
}
|
||||
|
||||
|
||||
analyzeAnswer(response, "ProfilesAvailable", callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<List<String>>> call, final Throwable t) {
|
||||
|
||||
Log.e("ProfilesAvailable", t.toString());
|
||||
callback.onFailed(new Exception(t));
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@ -67,36 +44,13 @@ public class SystemRESTConsumer {
|
||||
service.getAvailableCodMdeps().enqueue(new Callback<ServiceRESTResponse<List<AvailableCodMdepsDTO>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> call, Response<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> response) {
|
||||
|
||||
if(response.isSuccessful()) {
|
||||
|
||||
if(response.body() != null) {
|
||||
if(response.body().getEsito() == EsitoType.OK) {
|
||||
callback.onSuccess(response.body().getDto());
|
||||
} else {
|
||||
Log.e("CodMdepsAvailable", response.body().getErrorMessage());
|
||||
callback.onFailed(new Exception(response.body().getErrorMessage()));
|
||||
}
|
||||
} else {
|
||||
Log.e("CodMdepsAvailable", response.message());
|
||||
callback.onFailed(new Exception(response.message()));
|
||||
}
|
||||
} else {
|
||||
Log.e("CodMdepsAvailable", "Status " + response.code() + ": " + response.message());
|
||||
callback.onFailed(new Exception("Status " + response.code() + ": " + response.message()));
|
||||
}
|
||||
|
||||
|
||||
analyzeAnswer(response, "CodMdepsAvailable", callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> call, final Throwable t) {
|
||||
|
||||
Log.e("CodMdepsAvailable", t.toString());
|
||||
callback.onFailed(new Exception(t));
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
package it.integry.integrywmsnative.core.REST.consumers;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.model.EsitoType;
|
||||
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import retrofit2.Response;
|
||||
|
||||
public class _BaseRESTConsumer {
|
||||
|
||||
|
||||
public static <T> void analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle, final ISimpleOperationCallback<T> callback){
|
||||
if(response.isSuccessful()) {
|
||||
if(response.body() != null) {
|
||||
if(response.body().getEsito() == EsitoType.OK) {
|
||||
if(!UtilityString.isNullOrEmpty(response.body().getErrorMessage())){
|
||||
callback.onFailed(new Exception(response.body().getErrorMessage()));
|
||||
} else callback.onSuccess(response.body().getDto());
|
||||
} else {
|
||||
Log.e(logTitle, response.body().getErrorMessage());
|
||||
callback.onFailed(new Exception(response.body().getErrorMessage()));
|
||||
}
|
||||
} else {
|
||||
Log.e(logTitle, response.message());
|
||||
callback.onFailed(new Exception(response.message()));
|
||||
}
|
||||
} else {
|
||||
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
||||
callback.onFailed(new Exception("Status " + response.code() + ": " + response.message()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -2,13 +2,28 @@ package it.integry.integrywmsnative.core.REST.watcher;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISingleValueOperationCallback;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityServer;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
|
||||
public class ServerStatusChecker {
|
||||
|
||||
private ISingleValueOperationCallback<Boolean> mCallback;
|
||||
private static ServerStatusChecker istance = new ServerStatusChecker();
|
||||
|
||||
private List<ISingleValueOperationCallback<Boolean>> mCallback = new ArrayList<>();
|
||||
|
||||
private ISingleValueOperationCallback<Boolean> mInternalCallback = new ISingleValueOperationCallback<Boolean>() {
|
||||
@Override
|
||||
public void onResult(Boolean value) {
|
||||
for (ISingleValueOperationCallback callback : mCallback) {
|
||||
callback.onResult(value);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private boolean shouldExecute = true;
|
||||
private final long MILLIS_DELAY = 5 * 1000;
|
||||
@ -18,22 +33,35 @@ public class ServerStatusChecker {
|
||||
private Runnable runnableCode = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(shouldExecute) {
|
||||
UtilityServer.isHostReachable(SettingsManager.i().server.host, SettingsManager.i().server.port, mCallback);
|
||||
if(shouldExecute && !UtilityString.isNullOrEmpty(SettingsManager.i().server.host)) {
|
||||
UtilityServer.isHostReachable(SettingsManager.i().server.host, SettingsManager.i().server.port, mInternalCallback);
|
||||
handler.postDelayed(this, MILLIS_DELAY);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public void startMonitoring(ISingleValueOperationCallback<Boolean> callback){
|
||||
this.mCallback = callback;
|
||||
shouldExecute = true;
|
||||
public void addCallback(ISingleValueOperationCallback<Boolean> callback){
|
||||
this.mCallback.add(callback);
|
||||
|
||||
handler.post(runnableCode);
|
||||
}
|
||||
|
||||
public void stopMonitoring(){
|
||||
shouldExecute = false;
|
||||
public void removeCallback(ISingleValueOperationCallback<Boolean> callback){
|
||||
this.mCallback.remove(callback);
|
||||
}
|
||||
|
||||
|
||||
public static void init(){
|
||||
istance.shouldExecute = true;
|
||||
|
||||
istance.handler.post(istance.runnableCode);
|
||||
}
|
||||
|
||||
public static void dispose() {
|
||||
istance.shouldExecute = false;
|
||||
}
|
||||
|
||||
public static ServerStatusChecker getIstance() {
|
||||
return istance;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
|
||||
/**
|
||||
* Created by GiuseppeS on 06/03/2018.
|
||||
@ -49,6 +50,30 @@ public class MtbColt extends EntityBase{
|
||||
private BigDecimal larghezzaCm;
|
||||
private BigDecimal altezzaCm;
|
||||
|
||||
public void generaFiltroOrdine() throws Exception {
|
||||
|
||||
if (this.gestione == null) {
|
||||
throw new Exception("Impossibile creare il filtro dell'ordine se la gestione non è valorizzata");
|
||||
}
|
||||
|
||||
if (this.dataOrd == null) {
|
||||
throw new Exception("Impossibile creare il filtro dell'ordine se la data dell'ordine non è valorizzata");
|
||||
}
|
||||
|
||||
if (this.numOrd == null) {
|
||||
throw new Exception("Impossibile creare il filtro dell'ordine se il numero dell'ordine non è valorizzato");
|
||||
}
|
||||
|
||||
|
||||
Date dateOrd = UtilityDate.recognizeDate(this.dataOrd);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
|
||||
String dateYMD = sdf.format(dateOrd);
|
||||
|
||||
this.filtroOrdini = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ROOT><FILTER><DTB_ORDT><GESTIONE type=\"V\">" + this.gestione + "</GESTIONE><DATA_ORD type=\"D\">" + dateYMD + "</DATA_ORD><NUM_ORD type=\"N\">" + this.numOrd + "</NUM_ORD></DTB_ORDT></FILTER></ROOT>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
private ObservableArrayList<MtbColr> mtbColr = new ObservableArrayList<>();
|
||||
|
||||
public ObservableArrayList<MtbColr> getMtbColr() {
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
package it.integry.integrywmsnative.core.settings;
|
||||
|
||||
public final class SharedPrefKeys {
|
||||
|
||||
|
||||
public static final String ACCETTAZIONE_PRINTER = "accettazione_printer";
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.List;
|
||||
|
||||
public class UtilityArray {
|
||||
|
||||
public static<T> T[] listToArray(List<T> inputList, Class<T> c) {
|
||||
|
||||
T[] result = (T[]) Array.newInstance(c, inputList.size());
|
||||
result = inputList.toArray(result);
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -7,7 +7,7 @@ package it.integry.integrywmsnative.core.utility;
|
||||
public class UtilityString {
|
||||
|
||||
public static boolean isNullOrEmpty(String stringToCheck){
|
||||
return stringToCheck == null || stringToCheck.equalsIgnoreCase("");
|
||||
return stringToCheck == null || stringToCheck.trim().length() == 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package it.integry.integrywmsnative.core.wifi;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISingleValueOperationCallback;
|
||||
@ -11,10 +13,10 @@ public class WiFiCheckerViewHolder implements ISingleValueOperationCallback<WiFi
|
||||
|
||||
private WiFiStatusChecker mWiFiStatusChecker;
|
||||
|
||||
public WiFiCheckerViewHolder(Activity activity, int rsid){
|
||||
mWifiSignalTextView = activity.findViewById(rsid);
|
||||
public WiFiCheckerViewHolder(Context context, View view, int rsid){
|
||||
mWifiSignalTextView = view.findViewById(rsid);
|
||||
|
||||
mWiFiStatusChecker = new WiFiStatusChecker(activity);
|
||||
mWiFiStatusChecker = new WiFiStatusChecker(context);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package it.integry.integrywmsnative.gest.accettazione.core;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@ -12,6 +11,7 @@ import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.REST.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.REST.model.EsitoType;
|
||||
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.gest.accettazione.core.interfaces.ILoadOrdiniCallback;
|
||||
import it.integry.integrywmsnative.gest.accettazione.core.interfaces.ILoadPickingListCallback;
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneDTO;
|
||||
@ -35,10 +35,10 @@ public class AccettazioneHelper {
|
||||
}
|
||||
|
||||
public void loadOrdini(final ILoadOrdiniCallback callback){
|
||||
|
||||
String codMdep = SettingsManager.i().userSession.codMdep;
|
||||
|
||||
OrdiniAccettazioneRESTConsumerService service = RESTBuilder.getService(OrdiniAccettazioneRESTConsumerService.class);
|
||||
service.listOrdiniInevasi().enqueue(new Callback<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>>() {
|
||||
service.listOrdiniInevasi(codMdep).enqueue(new Callback<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>> call, Response<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>> response) {
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ import retrofit2.http.Query;
|
||||
public interface OrdiniAccettazioneRESTConsumerService {
|
||||
|
||||
@GET("SM2GetOrdiniAccettazioneInevasi")
|
||||
Call<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>> listOrdiniInevasi();
|
||||
Call<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>> listOrdiniInevasi(@Query("codMdep") String codMdep);
|
||||
|
||||
@GET("WMSGetPickingListAccettazione")
|
||||
Call<ServiceRESTResponse<List<OrdineAccettazioneDTO>>> pickingListAccettazione(@Query("codBarreBancale") String codBarreBacale);
|
||||
|
||||
@ -1,19 +1,16 @@
|
||||
package it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.core;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SyncRequest;
|
||||
import android.databinding.ObservableArrayList;
|
||||
import android.util.Log;
|
||||
|
||||
import com.orhanobut.logger.Logger;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.SortedSet;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.coollection.Coollection;
|
||||
@ -167,13 +164,11 @@ public class AccettazioneOrdineInevasoHelper {
|
||||
}
|
||||
}
|
||||
|
||||
Collections.sort(commessaList, new Comparator<RaggruppaPerCommessaUtilDTO>() {
|
||||
public int compare(RaggruppaPerCommessaUtilDTO dto1, RaggruppaPerCommessaUtilDTO dto2) {
|
||||
if(dto1.ragSocCom == null || dto2.codJcom.equalsIgnoreCase("MAG")) return -1;
|
||||
if(dto2.ragSocCom == null || dto1.codJcom.equalsIgnoreCase("MAG")) return 1;
|
||||
Collections.sort(commessaList, (dto1, dto2) -> {
|
||||
if(dto1.ragSocCom == null || dto2.codJcom.equalsIgnoreCase("MAG")) return -1;
|
||||
if(dto2.ragSocCom == null || dto1.codJcom.equalsIgnoreCase("MAG")) return 1;
|
||||
|
||||
return dto1.ragSocCom.compareToIgnoreCase(dto2.ragSocCom);
|
||||
}
|
||||
return dto1.ragSocCom.compareToIgnoreCase(dto2.ragSocCom);
|
||||
});
|
||||
|
||||
List<List<OrdineAccettazioneDTO.Riga>> groupedRighe = new ArrayList<>();
|
||||
@ -190,11 +185,11 @@ public class AccettazioneOrdineInevasoHelper {
|
||||
}
|
||||
}
|
||||
|
||||
Collections.sort(tmpList, new Comparator<OrdineAccettazioneDTO.Riga>() {
|
||||
public int compare(OrdineAccettazioneDTO.Riga obj1, OrdineAccettazioneDTO.Riga obj2) {
|
||||
return obj1.mtbAart.descrizioneEstesa.compareToIgnoreCase(obj2.mtbAart.descrizioneEstesa);
|
||||
}
|
||||
});
|
||||
Collections.sort(tmpList, (obj1, obj2) -> obj1.mtbAart.descrizioneEstesa.compareToIgnoreCase(obj2.mtbAart.descrizioneEstesa));
|
||||
|
||||
for(int i = 0; i < tmpList.size(); i++) {
|
||||
Logger.d(tmpList.get(i));
|
||||
}
|
||||
|
||||
if(tmpList.size() > 0){
|
||||
groupedRighe.add(tmpList);
|
||||
@ -250,7 +245,11 @@ public class AccettazioneOrdineInevasoHelper {
|
||||
for(int i = 0; i < groupedRighe.size(); i++){
|
||||
AccettazioneOrdineInevasoListViewModel itemModel = new AccettazioneOrdineInevasoListViewModel();
|
||||
|
||||
itemModel.descrizioneGroup = groupedRighe.get(i).get(0).codJcom;
|
||||
if(groupedRighe.get(i).get(0).codJcom.equalsIgnoreCase("N/A")){
|
||||
itemModel.descrizioneGroup = mContext.getString(R.string.warehouse).toUpperCase();
|
||||
} else {
|
||||
itemModel.descrizioneGroup = groupedRighe.get(i).get(0).codJcom;
|
||||
}
|
||||
|
||||
if(groupedRighe.get(i).get(0).ragSocCom != null && groupedRighe.get(i).get(0).ragSocCom.trim().length() > 0){
|
||||
itemModel.descrizioneGroup += " - " + groupedRighe.get(i).get(0).ragSocCom;
|
||||
|
||||
@ -168,12 +168,9 @@ public class MainListOrdineAccettazioneAdapter extends RecyclerView.Adapter<Main
|
||||
qtaTot.setText(rowItem.qtaOrdinata);
|
||||
|
||||
|
||||
groupModelView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if(mOrdineRowDispatch != null){
|
||||
mOrdineRowDispatch.onOrdineRowDispatch(rowItem.originalModel);
|
||||
}
|
||||
groupModelView.setOnClickListener(view -> {
|
||||
if(mOrdineRowDispatch != null){
|
||||
mOrdineRowDispatch.onOrdineRowDispatch(rowItem.originalModel);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ public class AccettazioneOrdineInevasoOrderBy {
|
||||
public static String[] descriptions = new String[] {
|
||||
"Cod articolo fornitore",
|
||||
"Descrizione articolo",
|
||||
"Ragione sociale commessa"
|
||||
"Commessa - Articolo"
|
||||
};
|
||||
|
||||
public enum Enum {
|
||||
|
||||
@ -4,25 +4,24 @@ import android.app.ProgressDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.databinding.ObservableArrayList;
|
||||
import android.databinding.ObservableField;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.content.res.ResourcesCompat;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.text.SpannableString;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import br.com.zbra.androidlinq.delegate.Selector;
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.REST.CommonRESTException;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISimpleOperationCallback;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISingleValueOperationCallback;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.coollection.Coollection;
|
||||
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
@ -43,6 +42,8 @@ import it.integry.integrywmsnative.view.dialogs.DialogSimpleMessageHelper;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity.DialogInputQuantity;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity.QuantityDTO;
|
||||
|
||||
import static br.com.zbra.androidlinq.Linq.stream;
|
||||
|
||||
public class AccettazioneOnOrdineInevasoViewModel implements IOnColloClosedCallback, IOnOrdineRowDispatchCallback {
|
||||
|
||||
public ObservableField<Boolean> isFabVisible = new ObservableField<>();
|
||||
@ -179,7 +180,43 @@ public class AccettazioneOnOrdineInevasoViewModel implements IOnColloClosedCallb
|
||||
.setAnnotazioni(noteString)
|
||||
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
List<String> codAnags =
|
||||
stream(mOrders)
|
||||
.select(c -> c.codAnag)
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if(codAnags != null && codAnags.size() == 1){
|
||||
mtbColt.setCodAnag(codAnags.get(0));
|
||||
}
|
||||
|
||||
List<String> rifOrds =
|
||||
stream(mOrders)
|
||||
.select(c -> c.rifOrd)
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if(rifOrds != null && rifOrds.size() == 1){
|
||||
mtbColt.setRifOrd(rifOrds.get(0));
|
||||
}
|
||||
|
||||
List<String> numDataOrds =
|
||||
stream(mOrders)
|
||||
.select(value -> ("" + value.numero) + value.data)
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if(numDataOrds != null && numDataOrds.size() == 1){
|
||||
mtbColt.setNumOrd(mOrders.get(0).numero);
|
||||
mtbColt.setDataOrd(mOrders.get(0).data);
|
||||
|
||||
try {
|
||||
mtbColt.generaFiltroOrdine();
|
||||
} catch (Exception ex) {
|
||||
DialogSimpleMessageHelper.makeErrorDialog(mActivity, new SpannableString(ex.getMessage()), null, null).show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ColliMagazzinoRESTConsumer.saveCollo(mtbColt, new ISimpleOperationCallback<MtbColt>() {
|
||||
@ -187,7 +224,7 @@ public class AccettazioneOnOrdineInevasoViewModel implements IOnColloClosedCallb
|
||||
public void onSuccess(MtbColt value) {
|
||||
|
||||
isFabVisible.set(false);
|
||||
value.setMtbColr(new ObservableArrayList<MtbColr>());
|
||||
value.setMtbColr(new ObservableArrayList<>());
|
||||
|
||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(value);
|
||||
|
||||
@ -238,9 +275,39 @@ public class AccettazioneOnOrdineInevasoViewModel implements IOnColloClosedCallb
|
||||
|
||||
@Override
|
||||
public void onColloClosed() {
|
||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
||||
if(mArticoliInColloBottomSheetViewModel.mtbColt.get() != null) {
|
||||
|
||||
final ProgressDialog progress = ProgressDialog.show(mActivity, mActivity.getText(R.string.waiting),
|
||||
mActivity.getText(R.string.loading) + " ...", true);
|
||||
|
||||
progress.show();
|
||||
|
||||
PrinterRESTConsumer.printCollo(
|
||||
"Brother MFC-L2700DW series Printer",
|
||||
mArticoliInColloBottomSheetViewModel.mtbColt.get(),
|
||||
1, "EtichettaBancale", new ISimpleOperationCallback<Object>() {
|
||||
@Override
|
||||
public void onSuccess(Object value) {
|
||||
|
||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
||||
|
||||
isFabVisible.set(true);
|
||||
|
||||
progress.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
progress.dismiss();
|
||||
String errorMessage = CommonRESTException.tryRecognizeThenGetMessage(ex);
|
||||
|
||||
if(errorMessage == null) errorMessage = ex.getMessage();
|
||||
DialogSimpleMessageHelper.makeErrorDialog(mActivity, new SpannableString(errorMessage), null, null).show();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
isFabVisible.set(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -106,43 +106,31 @@ public class LoginViewModel {
|
||||
final String host = u.getHost();
|
||||
final int port = u.getPort();
|
||||
|
||||
UtilityServer.isHostReachable(host, port, new ISingleValueOperationCallback<Boolean>() {
|
||||
@Override
|
||||
public void onResult(Boolean value) {
|
||||
UtilityServer.isHostReachable(host, port, value1 -> {
|
||||
|
||||
if(value){ //Is online
|
||||
loginHelper.doLogin(host, port, new ISimpleOperationCallback<LoginDTO>() {
|
||||
@Override
|
||||
public void onSuccess(final LoginDTO value) {
|
||||
if(value1){ //Is online
|
||||
loginHelper.doLogin(host, port, new ISimpleOperationCallback<LoginDTO>() {
|
||||
@Override
|
||||
public void onSuccess(final LoginDTO value1) {
|
||||
|
||||
SettingsManager.iDB().setAvailableProfiles(value.availableProfiles);
|
||||
SettingsManager.iDB().setAvailableProfiles(value1.availableProfiles);
|
||||
|
||||
mActivity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mActivity.runOnUiThread(() -> onLoginSuccess(
|
||||
"Benvenuto",
|
||||
Html.fromHtml("Ciao <b>" + value1.full_name + "</b>, la Integry le augura di svolgere al meglio il suo lavoro"),
|
||||
host, port, value1.availableProfiles));
|
||||
|
||||
onLoginSuccess(
|
||||
"Benvenuto",
|
||||
Html.fromHtml("Ciao <b>" + value.full_name + "</b>, la Integry le augura di svolgere al meglio il suo lavoro"),
|
||||
host, port, value.availableProfiles);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(final Exception ex) {
|
||||
onLoginFailed(new SpannableString(ex.getMessage().toString()));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(final Exception ex) {
|
||||
onLoginFailed(new SpannableString(ex.getMessage().toString()));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
} else { //Is not online
|
||||
onLoginFailed(Html.fromHtml(String.format(mActivity.getText(R.string.server_not_reachable).toString(), host, port)));
|
||||
}
|
||||
|
||||
} else { //Is not online
|
||||
onLoginFailed(Html.fromHtml(String.format(mActivity.getText(R.string.server_not_reachable).toString(), host, port)));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@ -0,0 +1,102 @@
|
||||
package it.integry.integrywmsnative.gest.main;
|
||||
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import net.cachapa.expandablelayout.ExpandableLayout;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISimpleOperationCallback;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISingleValueOperationCallback;
|
||||
import it.integry.integrywmsnative.core.REST.watcher.ServerStatusChecker;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.wifi.WiFiCheckerViewHolder;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
* Use the {@link MainFragment#newInstance} factory method to
|
||||
* create an instance of this fragment.
|
||||
*/
|
||||
public class MainFragment extends Fragment {
|
||||
|
||||
|
||||
@BindView(R.id.no_connection_top_layout) ExpandableLayout mNoConnectionLayout;
|
||||
|
||||
private View mView;
|
||||
|
||||
public MainFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
public static MainFragment newInstance() {
|
||||
MainFragment fragment = new MainFragment();
|
||||
Bundle args = new Bundle();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
mView = inflater.inflate(R.layout.fragment_main, container, false);
|
||||
|
||||
ButterKnife.bind(this, mView);
|
||||
|
||||
init();
|
||||
return mView;
|
||||
}
|
||||
|
||||
|
||||
private void init(){
|
||||
ServerStatusChecker.getIstance().addCallback(new ISingleValueOperationCallback<Boolean>() {
|
||||
@Override
|
||||
public void onResult(Boolean value) {
|
||||
if(value && mNoConnectionLayout.isExpanded()){
|
||||
|
||||
collapseNoConnectionLayout();
|
||||
|
||||
|
||||
} else if(!value && !mNoConnectionLayout.isExpanded()){
|
||||
expandNoConnectionLayout();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
WiFiCheckerViewHolder wiFiCheckerViewHolder = new WiFiCheckerViewHolder(getActivity(), mView, R.id.wifi_power);
|
||||
wiFiCheckerViewHolder.startMonitoring();
|
||||
}
|
||||
|
||||
private void collapseNoConnectionLayout(){
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mNoConnectionLayout.collapse(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void expandNoConnectionLayout(){
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mNoConnectionLayout.expand(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package it.integry.integrywmsnative.gest.settings;
|
||||
|
||||
import android.content.Context;
|
||||
import android.databinding.DataBindingUtil;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import butterknife.ButterKnife;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.databinding.FragmentMainSettingsBinding;
|
||||
import it.integry.integrywmsnative.gest.accettazione.core.interfaces.ITitledFragment;
|
||||
|
||||
public class MainSettingsFragment extends Fragment implements ITitledFragment {
|
||||
|
||||
private FragmentMainSettingsBinding mBinding;
|
||||
|
||||
public MainSettingsFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
public static MainSettingsFragment newInstance() {
|
||||
MainSettingsFragment fragment = new MainSettingsFragment();
|
||||
Bundle args = new Bundle();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle(Context context){
|
||||
return context.getText(R.string.settings_category).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
//init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
|
||||
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_main_settings, container, false);
|
||||
|
||||
ButterKnife.bind(this, mBinding.getRoot());
|
||||
|
||||
return mBinding.getRoot();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,99 @@
|
||||
package it.integry.integrywmsnative.gest.settings;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.preference.CheckBoxPreference;
|
||||
import android.support.v7.preference.EditTextPreference;
|
||||
import android.support.v7.preference.ListPreference;
|
||||
import android.support.v7.preference.PreferenceCategory;
|
||||
import android.support.v7.preference.PreferenceFragmentCompat;
|
||||
import android.support.v7.preference.PreferenceScreen;
|
||||
import android.support.v7.view.ContextThemeWrapper;
|
||||
import android.util.TypedValue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISimpleOperationCallback;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.settings.SharedPrefKeys;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityArray;
|
||||
import it.integry.integrywmsnative.gest.accettazione.core.interfaces.ITitledFragment;
|
||||
|
||||
import static br.com.zbra.androidlinq.Linq.stream;
|
||||
|
||||
public class SettingsPreferenceFragment extends PreferenceFragmentCompat implements ITitledFragment {
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle bundle, String s) {
|
||||
|
||||
PrinterRESTConsumer.getAvailablePrinters(new ISimpleOperationCallback<List<String>>() {
|
||||
@Override
|
||||
public void onSuccess(final List<String> availablePrinters) {
|
||||
initScreen(availablePrinters);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String getTitle(Context context) {
|
||||
return context.getText(R.string.settings_category).toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void initScreen(List<String> availablePrinters) {
|
||||
// Load the Preferences from the XML file
|
||||
Context activityContext = getActivity();
|
||||
|
||||
PreferenceScreen preferenceScreen = getPreferenceManager().createPreferenceScreen(activityContext);
|
||||
setPreferenceScreen(preferenceScreen);
|
||||
|
||||
TypedValue themeTypedValue = new TypedValue();
|
||||
activityContext.getTheme().resolveAttribute(R.attr.preferenceTheme, themeTypedValue, true);
|
||||
ContextThemeWrapper contextThemeWrapper = new ContextThemeWrapper(activityContext, themeTypedValue.resourceId);
|
||||
|
||||
// We instance each Preference using our ContextThemeWrapper object
|
||||
PreferenceCategory preferenceCategory = new PreferenceCategory(contextThemeWrapper);
|
||||
preferenceCategory.setTitle("Category test");
|
||||
|
||||
EditTextPreference editTextPreference = new EditTextPreference(contextThemeWrapper);
|
||||
editTextPreference.setKey("edittext");
|
||||
editTextPreference.setTitle("EditText test");
|
||||
|
||||
CheckBoxPreference checkBoxPreference = new CheckBoxPreference(contextThemeWrapper);
|
||||
checkBoxPreference.setTitle("Checkbox test");
|
||||
checkBoxPreference.setKey("checkbox");
|
||||
checkBoxPreference.setChecked(true);
|
||||
|
||||
availablePrinters.add(0, "Nessuna");
|
||||
String[] availablePritersArray = UtilityArray.listToArray(availablePrinters, String.class);
|
||||
|
||||
ListPreference listPreferece = new ListPreference(contextThemeWrapper);
|
||||
listPreferece.setTitle("Current printer");
|
||||
listPreferece.setKey(SharedPrefKeys.ACCETTAZIONE_PRINTER);
|
||||
listPreferece.setEntries(availablePritersArray);
|
||||
listPreferece.setEntryValues(availablePritersArray);
|
||||
|
||||
// It's REALLY IMPORTANT to add Preferences with child Preferences to the Preference Hierarchy first
|
||||
// Otherwise, the PreferenceManager will fail to load their keys
|
||||
|
||||
// First we add the category to the root PreferenceScreen
|
||||
getPreferenceScreen().addPreference(preferenceCategory);
|
||||
|
||||
// Then their child to it
|
||||
preferenceCategory.addPreference(editTextPreference);
|
||||
preferenceCategory.addPreference(checkBoxPreference);
|
||||
preferenceCategory.addPreference(listPreferece);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0,0 0,2 12A10,10 0,0 0,12 22A10,10 0,0 0,22 12A10,10 0,0 0,12 2M11,17H13V11H11V17Z"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/ic_palette_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_palette_24dp.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M17.5,12A1.5,1.5 0,0 1,16 10.5A1.5,1.5 0,0 1,17.5 9A1.5,1.5 0,0 1,19 10.5A1.5,1.5 0,0 1,17.5 12M14.5,8A1.5,1.5 0,0 1,13 6.5A1.5,1.5 0,0 1,14.5 5A1.5,1.5 0,0 1,16 6.5A1.5,1.5 0,0 1,14.5 8M9.5,8A1.5,1.5 0,0 1,8 6.5A1.5,1.5 0,0 1,9.5 5A1.5,1.5 0,0 1,11 6.5A1.5,1.5 0,0 1,9.5 8M6.5,12A1.5,1.5 0,0 1,5 10.5A1.5,1.5 0,0 1,6.5 9A1.5,1.5 0,0 1,8 10.5A1.5,1.5 0,0 1,6.5 12M12,3A9,9 0,0 0,3 12A9,9 0,0 0,12 21A1.5,1.5 0,0 0,13.5 19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0,0 1,14.23 16H16A5,5 0,0 0,21 11C21,6.58 16.97,3 12,3Z"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/ic_settings_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_settings_24dp.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M12,15.5A3.5,3.5 0,0 1,8.5 12A3.5,3.5 0,0 1,12 8.5A3.5,3.5 0,0 1,15.5 12A3.5,3.5 0,0 1,12 15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z"/>
|
||||
</vector>
|
||||
@ -14,109 +14,6 @@
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<net.cachapa.expandablelayout.ExpandableLayout
|
||||
android:id="@+id/no_connection_top_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/gray_detail_background"
|
||||
app:el_duration="400"
|
||||
app:el_expanded="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingLeft="8dp"
|
||||
android:background="@color/red_600">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:text="NESSUNA CONNESSIONE DISPONIBILE, RIPROVA"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</net.cachapa.expandablelayout.ExpandableLayout>
|
||||
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
app:cardBackgroundColor="@android:color/white"
|
||||
app:cardCornerRadius="4dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:textColor="@android:color/black"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Informazioni generali"
|
||||
android:textAllCaps="true"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<LinearLayout
|
||||
android:padding="15dp"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<android.support.constraint.Guideline
|
||||
android:id="@+id/guideline1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.40"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="Segnale WI-FI"
|
||||
android:textColor="@android:color/black"
|
||||
app:layout_constraintEnd_toStartOf="@+id/guideline"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/wifi_power"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:layout_marginStart="0dp"
|
||||
android:text="N/A"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline1"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
112
app/src/main/res/layout/fragment_main.xml
Normal file
112
app/src/main/res/layout/fragment_main.xml
Normal file
@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".gest.main.MainFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<net.cachapa.expandablelayout.ExpandableLayout
|
||||
android:id="@+id/no_connection_top_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/gray_detail_background"
|
||||
app:el_duration="400"
|
||||
app:el_expanded="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingLeft="8dp"
|
||||
android:background="@color/red_600">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:text="NESSUNA CONNESSIONE DISPONIBILE, RIPROVA"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</net.cachapa.expandablelayout.ExpandableLayout>
|
||||
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
app:cardBackgroundColor="@android:color/white"
|
||||
app:cardCornerRadius="4dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:textColor="@android:color/black"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Informazioni generali"
|
||||
android:textAllCaps="true"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<LinearLayout
|
||||
android:padding="15dp"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<android.support.constraint.Guideline
|
||||
android:id="@+id/guideline1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.40"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="Segnale WI-FI"
|
||||
android:textColor="@android:color/black"
|
||||
app:layout_constraintEnd_toStartOf="@+id/guideline"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/wifi_power"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:layout_marginStart="0dp"
|
||||
android:text="N/A"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline1"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
8
app/src/main/res/layout/fragment_main_settings.xml
Normal file
8
app/src/main/res/layout/fragment_main_settings.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</layout>
|
||||
@ -35,6 +35,10 @@
|
||||
|
||||
<item android:title="Other">
|
||||
<menu>
|
||||
<item
|
||||
android:id="@+id/nav_settings"
|
||||
android:icon="@drawable/ic_settings_24dp"
|
||||
android:title="Settings" />
|
||||
<item
|
||||
android:id="@+id/nav_logout"
|
||||
android:icon="@drawable/ic_logout_24dp"
|
||||
|
||||
@ -29,6 +29,11 @@
|
||||
<string name="hint_additional_notes">Note Aggiuntive</string>
|
||||
<string name="dialog_message_additional_notes">Inserisci eventuali note aggiuntive della tua UL</string>
|
||||
|
||||
<string name="warehouse">Magazzino</string>
|
||||
|
||||
<!-- SETTINGS -->
|
||||
<string name="general_settings">Settaggi generali</string>
|
||||
|
||||
<plurals name="references">
|
||||
<item quantity="one">referenza</item>
|
||||
<item quantity="other">referenze</item>
|
||||
@ -84,4 +89,7 @@
|
||||
<string name="data_saved">Salvataggio completato</string>
|
||||
|
||||
<string name="wrong_quantity_input"><![CDATA[La quantità inserita non è valida]]></string>
|
||||
<string name="settings_category">Impostazioni</string>
|
||||
<string name="check_box_preference_title">Check box</string>
|
||||
<string name="check_box_preference_summary">This is a regular preference</string>
|
||||
</resources>
|
||||
@ -37,6 +37,10 @@
|
||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||
|
||||
|
||||
<!-- SETTINGS -->
|
||||
<string name="general_settings">General settings</string>
|
||||
|
||||
|
||||
<plurals name="references">
|
||||
<item quantity="one">reference</item>
|
||||
<item quantity="other">references</item>
|
||||
@ -91,5 +95,11 @@
|
||||
<string name="data_saved">Data saved</string>
|
||||
|
||||
<string name="wrong_quantity_input">The quantity entered is not valid, please check it</string>
|
||||
<string name="settings_category">Settings</string>
|
||||
<string name="check_box_preference_title">Check box</string>
|
||||
<string name="check_box_preference_summary">This is a regular preference</string>
|
||||
|
||||
|
||||
<string name="warehouse">Warehouse</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@ -2,6 +2,9 @@
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
|
||||
<item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
|
||||
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
|
||||
27
app/src/main/res/xml/app_preferences.xml
Normal file
27
app/src/main/res/xml/app_preferences.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<android.support.v7.preference.PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<android.support.v7.preference.PreferenceCategory
|
||||
android:title="@string/general_settings">
|
||||
|
||||
<android.support.v7.preference.SwitchPreferenceCompat
|
||||
android:key="key1"
|
||||
android:title="Switch Preference"
|
||||
android:summary="Switch Summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<android.support.v7.preference.EditTextPreference
|
||||
android:key="key2"
|
||||
android:title="EditText Preference"
|
||||
android:summary="EditText Summary"
|
||||
android:dialogMessage="Dialog Message"
|
||||
android:defaultValue="Default value" />
|
||||
|
||||
<android.support.v7.preference.CheckBoxPreference
|
||||
android:key="key3"
|
||||
android:title="CheckBox Preference"
|
||||
android:summary="CheckBox Summary"
|
||||
android:defaultValue="true"/>
|
||||
</android.support.v7.preference.PreferenceCategory>
|
||||
|
||||
</android.support.v7.preference.PreferenceScreen>
|
||||
@ -1,7 +1,7 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.2.30'
|
||||
ext.kotlin_version = '1.2.61'
|
||||
repositories {
|
||||
jcenter()
|
||||
maven {
|
||||
@ -11,7 +11,7 @@ buildscript {
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.1.3'
|
||||
classpath 'com.android.tools.build:gradle:3.2.1'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
@ -26,6 +26,7 @@ allprojects {
|
||||
url 'https://maven.google.com/'
|
||||
name 'Google'
|
||||
}
|
||||
maven { url 'https://jitpack.io' }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
||||
#Thu Mar 29 10:39:25 CEST 2018
|
||||
#Wed Sep 26 16:49:03 CEST 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user