Skip to content

Instantly share code, notes, and snippets.

View ktvipin27's full-sized avatar
🏠
Working from home

Vipin K T ktvipin27

🏠
Working from home
View GitHub Profile
@ktvipin27
ktvipin27 / build.gradle
Created July 4, 2020 14:18
library level build.gradle file for bintray publishing
dependencies {
//...
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
classpath "com.github.dcendents:android-maven-gradle-plugin:2.1"
}
@ktvipin27
ktvipin27 / build.gradle
Last active July 4, 2020 11:02
library level build.gradle file for Bintray publishing
ext {
bintrayRepo = 'RoomInspector'
bintrayName = 'com.ktvipin.roominspector'
publishedGroupId = 'com.ktvipin'
libraryName = 'library'
artifact = 'roominspector'
libraryDescription = 'An in-app database inspector for Room databases.'
libraryVersion = '1.0.2'
@ktvipin27
ktvipin27 / release.yml
Last active July 4, 2020 10:53
Workflow file for automating github release and bintray upload
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
@ktvipin27
ktvipin27 / release.yml
Last active July 4, 2020 10:54
Sample workflow file for automating bintray upload
publish:
name: Publish Build
runs-on: ubuntu-latest
needs: release
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Configure JDK
@ktvipin27
ktvipin27 / publish.gradle
Last active July 4, 2020 11:07
Sample publish.gradle file for automating bintray release
bintray {
user = System.getenv("bintrayUser")
key = System.getenv("bintrayApiKey")
//...
}
@ktvipin27
ktvipin27 / release.yml
Last active July 4, 2020 11:15
Sample workflow file for automating github release
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
@ktvipin27
ktvipin27 / build.gradle
Created June 28, 2020 05:50
project level build.gradle file for cameraX sample
dependencies {
//...
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.2.2"
}
@ktvipin27
ktvipin27 / nav_graph.xml
Last active June 27, 2020 07:36
navigation graph for cameraX sample
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nav_graph"
app:startDestination="@id/cameraFragment">
<fragment
android:id="@+id/permissionFragment"
android:name="com.ktvipin.cameraxsample.ui.permission.PermissionFragment"
android:label="PermissionFragment"/>
@ktvipin27
ktvipin27 / MediaViewerFragment.kt
Created June 26, 2020 15:42
Fragment for displaying media preview in cameraX sample
class MediaViewerFragment : Fragment(R.layout.fragment_media_viewer) {
private val args: MediaViewerFragmentArgs by navArgs()
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btnBack.setOnClickListener { findNavController().popBackStack() }
val mediaUri = args.mediaUri
@ktvipin27
ktvipin27 / CameraFragment.kt
Created June 26, 2020 12:21
CameraFragment for cameraX sample
class CameraFragment : Fragment(R.layout.fragment_camera), ControlView.Listener {
//...
override fun onResume() {
super.onResume()
if (!PermissionFragment.hasPermissions(requireContext()))
findNavController()
.navigate(CameraFragmentDirections.actionCameraFragmentToPermissionFragment())
}