This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@AndroidEntryPoint | |
class LoginFragment : BaseBindingFragment<LoginFragmentBinding>() { | |
companion object { | |
fun screen() = FragmentScreen { LoginFragment() } | |
} | |
private val viewModel: LoginViewModel by viewModels() | |
override val bindingInflater: (LayoutInflater, ViewGroup?, Boolean) -> LoginFragmentBinding = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AuthActivityVM(application: Application) : BaseAndroidViewModel(application), LifecycleObserver { | |
var authClient = DokiMainClient.create(UserConfig.getServerUrl()) | |
fun changePass(oldPass: String, newPass: String) { | |
vmState.postValue(ViewModelState.ProgressState(true)) | |
compositeDisposable.add( | |
makeAsync(authClient.changePassword(oldPass, newPass)) | |
.subscribe({ | |
vmState.postValue(ViewModelState.SuccessChangePass()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.annotation.SuppressLint; | |
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.*; | |
import android.os.Build; | |
import androidx.annotation.ColorInt; | |
import androidx.annotation.ColorRes; | |
import androidx.annotation.StringRes; | |
import androidx.core.content.ContextCompat; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
public extension UIViewController { | |
func setTitle(title:String) { | |
self.title = title | |
} | |
func setEmptyBackArrow(){ | |
// удаляет текст возле кнопки назад |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.user.testapphandh; | |
import android.util.Patterns; | |
import java.util.regex.Pattern; | |
public class ValidationHelper { | |
/* | |
( # Start of group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android.applicationVariants.all { variant -> | |
variant.outputs.all { | |
outputFileName = "${variant.flavorName}-${variant.buildType.name}-${variant.versionCode}.apk" | |
} | |
} | |
android.applicationVariants.all { variant -> | |
variant.outputs.all { | |
outputFileName = "appName-${variant.buildType.name}-vCode-${variant.versionCode}-vName-${variant.versionName}.apk" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AbstractFragment extends Fragment { | |
protected int fragmentId, toolbarTitle; | |
private FragmentActivity activity; | |
public AbstractFragment() { | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Intent convertImplicitIntentToExplicitIntent(Intent implicitIntent, Context context) { | |
PackageManager pm = context.getPackageManager(); | |
List<ResolveInfo> resolveInfoList = pm.queryIntentServices(implicitIntent, 0); | |
if (resolveInfoList == null || resolveInfoList.size() != 1) { | |
return null; | |
} | |
ResolveInfo serviceInfo = resolveInfoList.get(0); | |
ComponentName component = new ComponentName(serviceInfo.serviceInfo.packageName, serviceInfo.serviceInfo.name); | |
Intent explicitIntent = new Intent(implicitIntent); | |
explicitIntent.setComponent(component); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void sendImplicitBroadcast(Context ctxt, Intent i) { | |
PackageManager pm = ctxt.getPackageManager(); | |
List<ResolveInfo> matches = pm.queryBroadcastReceivers(i, 0); | |
for (ResolveInfo resolveInfo : matches) { | |
Intent explicit = new Intent(i); | |
ComponentName cn = | |
new ComponentName(resolveInfo.activityInfo.applicationInfo.packageName, | |
resolveInfo.activityInfo.name); |
NewerOlder