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.ngengeapps.cameraxnew | |
import android.annotation.SuppressLint | |
import android.content.ContentValues | |
import android.os.Bundle | |
import android.provider.MediaStore | |
import androidx.annotation.OptIn | |
import androidx.appcompat.app.AppCompatActivity | |
import androidx.camera.core.CameraSelector | |
import androidx.camera.core.Preview |
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 AndroidUtils { | |
public static LiveData<List<WorkInfo>> generateProofWithWorkManager(Context context, | |
File file) { | |
Uri uri = ProofModeUtils.INSTANCE | |
.getUriForFile(file, context, context.getPackageName()); | |
Data data = ProofModeUtils.INSTANCE | |
.createData(ProofModeUtils.MEDIA_KEY, uri.toString()); | |
OneTimeWorkRequest workRequest = new OneTimeWorkRequest |
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
object ProofModeUtils { | |
fun createData(key:String, value:Any?) : Data { | |
val builder = Data.Builder() | |
value?.let { | |
builder.putString(key,value.toString()) | |
} | |
return builder.build() | |
} | |
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.proofmode.proofmodelib.worker | |
import android.content.Context | |
import android.net.Uri | |
import androidx.work.Worker | |
import androidx.work.WorkerParameters | |
import androidx.work.workDataOf | |
import com.proofmode.proofmodelib.utils.ProofModeUtils | |
import org.witness.proofmode.ProofMode |
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 fun registerImagePicker() { | |
contentLaunch = registerForActivityResult(ActivityResultContracts.GetContent()) { | |
if (it != null) { | |
val `is` = contentResolver.openInputStream(it) | |
val bm = BitmapFactory.decodeStream(`is`) | |
createPalette(bm) | |
binding.imageView.setImageBitmap(bm) | |
} | |
} |
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 fun createPalette(bitmap:Bitmap){ | |
val palette = Palette.from(bitmap).generate() | |
palette.apply { | |
vibrantSwatch?.let { | |
binding.materialToolbar.setBackgroundColor(it.rgb) | |
binding.materialToolbar.title = "Vibrant:${it.rgb.hexString()}" | |
binding.materialToolbar.setTitleTextColor(it.titleTextColor) | |
} | |
darkVibrantSwatch?.let { | |
binding.materialToolbar3.setBackgroundColor(it.rgb) |
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
def media3_version = "1.0.0-beta02" | |
implementation "androidx.media3:media3-exoplayer:$media3_version" | |
implementation "androidx.media3:media3-exoplayer-dash:$media3_version" | |
implementation "androidx.media3:media3-exoplayer-hls:$media3_version" | |
implementation "androidx.media3:media3-exoplayer-rtsp:$media3_version" | |
implementation "androidx.media3:media3-datasource-cronet:$media3_version" | |
implementation "androidx.media3:media3-datasource-okhttp:$media3_version" | |
implementation "androidx.media3:media3-datasource-rtmp:$media3_version" | |
implementation "androidx.media3:media3-ui:$media3_version" |
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 MainFragment:Fragment() { | |
private val viewModel:SharedViewModel by activityViewModels() | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
observeKeyEventChanges() | |
} |
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 MainActivity:AppCompatActivity() { | |
// initialize the viewModel | |
private val viewModel:SharedViewModel by viewModels() | |
fun onCreate(savedInstanceState:Bundle?){ | |
} | |
NewerOlder