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 <T> T execute(final Request request, final Class<T> classOfT) throws IOException { | |
OkHttpClient client = new OkHttpClient(); | |
Response response = client.newCall(request).execute(); | |
return GOSN.fromJson(response.body().string(), classOfT); | |
} |
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
fun main() { | |
var hours = 4.0 | |
val fixedHours = 24.0 | |
val flatFee = 15.0 | |
val total: Double | |
val chargeAfterFiveHours = 0.5 | |
val chargeBeforeFiveHours = 1 | |
when { | |
hours > fixedHours -> { |
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
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout 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="wrap_content" | |
android:background="@android:color/transparent"> | |
<androidx.constraintlayout.widget.ConstraintLayout | |
android:id="@+id/actionsLayout" | |
android:layout_width="match_parent" |
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.content.Context | |
import android.net.ConnectivityManager | |
import android.net.Network | |
import android.net.NetworkCapabilities | |
import android.net.NetworkRequest | |
import android.os.Build | |
import androidx.lifecycle.LiveData | |
import androidx.lifecycle.MutableLiveData | |
/** |
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 checkWritePermissionAndProcessPdf() { | |
ActivityCompat.requestPermissions( | |
requireActivity(), | |
arrayOf(android.Manifest.permission.WRITE_EXTERNAL_STORAGE), REQUEST_CODE | |
) | |
if (checkSelfPermission( | |
requireContext(), | |
android.Manifest.permission.WRITE_EXTERNAL_STORAGE | |
) | |
== PackageManager.PERMISSION_GRANTED |
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 val itemTouchHelperCallback = object : SimpleCallback( | |
0, LEFT or RIGHT | |
) { | |
override fun onMove( | |
recyclerView: RecyclerView, | |
viewHolder: ViewHolder, | |
target: ViewHolder | |
): Boolean { | |
return false | |
} |