Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="120dp"
android:layout_height="60dp"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="5dp"
<!-- adding the drawable here -->
class MyAdapter(private val dataset: List<String>)
: RecyclerView.Adapter<MyAdapter.ViewHolder>() {
private var currentSelection = 0
/**
* The view holder.
*/
class ViewHolder(val view: View) : RecyclerView.ViewHolder(view) {
import com.arcane.coldstorageannotation.CacheKey
import com.arcane.coldstorageannotation.Freeze
import java.net.URL
/**
* Putting all the rest calls into this class and applying the annotation.
* It is optional to use the generatedClassName paramter. If no value is passed to it , the generated class
* will have the prefix Generated along with the original class name. Eg -> GeneratedMakeRemoteCallWithFreeze
**/
@Freeze(generatedClassName = "MyBeautifulCacheLayer")
import android.os.Bundle
import android.widget.Button
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import com.arcane.coldstoragecache.callback.OnOperationSuccessfulCallback
import com.arcane.generated.MyBeautifulCacheLayer
class FreezeCacheActivity : AppCompatActivity(), OnOperationSuccessfulCallback<String?> {
private lateinit var button: Button
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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/linearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image_1"
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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/linearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image_2"
package com.arcane.coldstorageexamples.activity
import android.os.Bundle
import android.widget.ImageView
import androidx.appcompat.app.AppCompatActivity
import com.arcane.coldstorageannotation.LoadImage
import com.arcane.coldstoragecache.cache.Cache
import com.arcane.coldstorageexamples.R
class LoadImageExampleActivity : AppCompatActivity() {
package com.arcane.coldstorageexamples.fragment
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.fragment.app.Fragment
import com.arcane.coldstorageannotation.LoadImage
import com.arcane.coldstoragecache.cache.Cache
@crypticminds
crypticminds / app.tsx
Created July 12, 2020 21:25
Regular route without splitting
import React from "react";
import { Route, Switch } from "react-router-dom";
import Home from "./home";
import Login from "./login";
import Profile from "./profile";
const MyComponent = () => {
return (
<Switch>
<Route path="/home">
import React , {lazy , Suspense} from "react";
import { Route, Switch } from "react-router-dom";
const Home = lazy(() =>
import("./home" /* webpackChunkName: "HomePage" */)
);
const Login = lazy(() =>
import("./login" /* webpackChunkName: "LoginPage" */)
);