This file contains hidden or 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.graphics.Matrix | |
import android.os.Bundle | |
import androidx.activity.ComponentActivity | |
import androidx.activity.compose.setContent | |
import androidx.compose.animation.core.LinearEasing | |
import androidx.compose.animation.core.RepeatMode | |
import androidx.compose.animation.core.animateFloat | |
import androidx.compose.animation.core.infiniteRepeatable | |
import androidx.compose.animation.core.rememberInfiniteTransition | |
import androidx.compose.animation.core.tween |
This file contains hidden or 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 'package:flutter/material.dart'; | |
abstract class BaseScreen extends StatefulWidget { | |
const BaseScreen({Key? key}) : super(key: key); | |
} |
This file contains hidden or 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 'package:freezed_annotation/freezed_annotation.dart'; | |
import 'dart:io'; | |
part 'NetworkRequestBody.freezed.dart'; | |
part 'NetworkResponse.freezed.dart'; | |
class AccessTokenResponse { | |
String? accessToken; | |
AccessTokenResponse.fromJson(Map<String, dynamic> json) { | |
accessToken = json['access_token']; |
This file contains hidden or 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
object MyCustomDialog { | |
fun <V : ViewDataBinding> showCustomBottomSheetDialog( | |
activity: Activity, | |
@LayoutRes layoutId: Int, | |
setCancelable: Boolean = false, | |
onSuccess: (Dialog, V) -> Unit | |
) { | |
val layout = | |
DataBindingUtil.inflate<V>(LayoutInflater.from(activity), layoutId, null, false) |
This file contains hidden or 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 org.dailyislam.android.utilities | |
import android.content.Context | |
import android.net.ConnectivityManager | |
import android.net.NetworkInfo | |
import android.telephony.TelephonyManager | |
import java.net.InetAddress | |
class ConnectivityUtil(private val applicationContext: Context) { |
This file contains hidden or 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
/** | |
* Set the adapter and call [clearReference] extension function in one call. | |
* Use this extension if the current Fragment is going to be REPLACED. (When using fragmentTransaction.add is not necessary) the back stack. | |
*/ | |
fun <VH : RecyclerView.ViewHolder> RecyclerView.setNullableAdapter( | |
adapter: RecyclerView.Adapter<VH> | |
) { | |
this.adapter = adapter | |
this.clearReference() |
This file contains hidden or 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 RPSCustomPainter extends CustomPainter { | |
@override | |
void paint(Canvas canvas, Size size) { | |
Paint paint = new Paint() | |
..color = Colors.blue | |
..style = PaintingStyle.stroke; | |
// Code for path | |
// From here .... | |
Path path = Path(); | |
path.moveTo(size.width * 0.07, size.height * 0.08); |
This file contains hidden or 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 fun getClient(): WebViewClient { | |
return object : WebViewClient() { | |
override fun shouldInterceptRequest( | |
view: WebView?, | |
request: WebResourceRequest? | |
): WebResourceResponse? { | |
return super.shouldInterceptRequest(view, request) | |
} | |
override fun shouldInterceptRequest(view: WebView?, url: String?): WebResourceResponse? { |
This file contains hidden or 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 Bitmap toBitmap(Image image) { | |
Image.Plane[] planes = image.getPlanes(); | |
ByteBuffer yBuffer = planes[0].getBuffer(); | |
ByteBuffer uBuffer = planes[1].getBuffer(); | |
ByteBuffer vBuffer = planes[2].getBuffer(); | |
int ySize = yBuffer.remaining(); | |
int uSize = uBuffer.remaining(); | |
int vSize = vBuffer.remaining(); |
This file contains hidden or 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
/** | |
* Wrapper class for handling Location related methods | |
*/ | |
class HuaweiLocationManager constructor(private val context : Context) { | |
//region vars | |
private val mFusedLocationProviderClient: FusedLocationProviderClient by lazy { | |
LocationServices.getFusedLocationProviderClient(context) | |
} |
NewerOlder