Skip to content

Instantly share code, notes, and snippets.

/**
* Created by Saurabh(aqua) in 2017.
*/
public class HideShowRecyclerParallaxActivity extends BaseActivity {
/* view binding */
@BindView(R.id.recycler_view)RecyclerView recyclerView;
@BindView(R.id.parallax_image)ImageView parallaxImage;
@BindView(R.id.tv_heading)AppTextView heading;
@aqua30
aqua30 / BaseActivity.java
Last active September 27, 2017 08:28
Hide the view binding using ButterKnife and Abstraction.
/**
* Created by Saurabh(aqua) on 21-03-2017.
*/
public abstract class BaseActivity extends AppCompatActivity implements LifecycleRegistryOwner {
private LifecycleRegistry lifecycleRegistry = new LifecycleRegistry(this);
private Unbinder unbinder;
@Override
package test;
import android.arch.lifecycle.LiveData;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
@aqua30
aqua30 / HideShowScrollParallaxActivity.java
Last active August 7, 2021 21:49
Show/Hide view on up/down scroll in android - Using ScrollView
/**
* Created by Saurabh(aqua) in 2017.
*/
public class ScrollActivity extends BaseActivity {
/* view binding */
@BindView(R.id.scrollView)ScrollView scrollView;
@BindView(R.id.parallax_image)ImageView parallaxImage;
@BindView(R.id.tv_perhour)TextView textView;
@aqua30
aqua30 / RecyclerParallaxActivity.java
Created September 20, 2017 08:05
Parallax effect using RecyclerView in the most simple way using scroll listener of recycler view.
/**
* Created by Saurabh(aqua) in 2017.
*/
public class RecyclerParallaxActivity extends BaseActivity {
/* view binding */
@BindView(R.id.recycler_view)RecyclerView recyclerView;
@BindView(R.id.parallax_image)ImageView parallaxImage;
@aqua30
aqua30 / build.gradle.kts
Last active October 31, 2021 08:51
Kotlin version of gradle file
val ktor_version: String by project
val kotlin_version: String by project
val logback_version: String by project
plugins {
application
kotlin("jvm") version "1.5.31"
id("org.jetbrains.kotlin.plugin.serialization") version "1.5.31"
}
@aqua30
aqua30 / Application.kt
Created October 31, 2021 08:53
Application class
fun main(args: Array<String>): Unit =
io.ktor.server.netty.EngineMain.main(args)
@Suppress("unused") // application.conf references the main function. This annotation prevents the IDE from marking it as unused.
fun Application.module() {
configureSerialization()
configureMonitoring()
registerDogsRoute()
}
@aqua30
aqua30 / application.conf
Created October 31, 2021 08:57
Application config
ktor {
deployment {
port = 8080
port = ${?PORT}
}
application {
modules = [ com.aqua30.ApplicationKt.module ]
}
}
@aqua30
aqua30 / background_curved_corners.xml
Created March 6, 2022 18:26
Curved rectangle background shape
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/white" />
<corners android:topLeftRadius="25dp" android:topRightRadius="25dp" />
</shape>
@aqua30
aqua30 / dialog_curved_corners.xml
Created March 6, 2022 18:28
Layout for bottom sheet dialog
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/curvedContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/button_selector"
android:orientation="horizontal">
</LinearLayout>