<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_height="match_parent">
<TextView
android:id="@+id/t1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="кальмары"
app:layout_constraintStart_toStartOf="parent" />
<View
android:id="@+id/t2"
android:layout_width="0dp"
android:layout_height="2dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:background="@drawable/dotted"
app:layout_constraintBottom_toBottomOf="@+id/t1"
app:layout_constraintEnd_toStartOf="@+id/t3"
app:layout_constraintStart_toEndOf="@+id/t1" />
<TextView
android:id="@+id/t3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="5 шт."
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke
android:color="#C7B299"
android:dashWidth="10px"
android:dashGap="10px"
android:width="1dp"/>
</shape>
encBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String encryptText = AESCrypt.encrypt(inputText.getText(), inputPassword.getText());
outputText.setText(encryptText);
}
});
decBtn .setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String decryptText = AESCrypt.decrypt(inputPassword.getText(), outputText.getText());
inputText.setText(decrypt);
}
});
//Функция регистрации
fun registration(args: Array<String>) {
compositeDisposable.add(
retofit.registrate(args)
.subscribe({
//User successful registered
//Do auth
authorization(args)
}, {
handleError(it)
})
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
)
}
//Функция авторизации
fun authorization(args: Array<String>) {
compositeDisposable.add(
retofit.auth(args)
.subscribe({
//User successful auth
//Do work after user auth
userSuccessfulAuth()
}, {
handleError(it)
})
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
)
}