Skip to content

Instantly share code, notes, and snippets.

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

Jimmy minhdangoz

🏠
Working from home
View GitHub Profile
@minhdangoz
minhdangoz / ConcurrencyHelpers.kt
Created May 4, 2022 01:52 — forked from objcode/ConcurrencyHelpers.kt
Helpers to control concurrency for one shot requests using Kotlin coroutines.
/* Copyright 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
// Authoer: The SwiftUI Lab
// Full article: https://swiftui-lab.com/scrollview-pull-to-refresh/
import SwiftUI
import Combine
struct Dog: Identifiable {
let id = UUID()
let name:String
let picture: String
// Authoer: The SwiftUI Lab
// Full article: https://swiftui-lab.com/scrollview-pull-to-refresh/
import SwiftUI
struct RefreshableScrollView<Content: View>: View {
@State private var previousScrollOffset: CGFloat = 0
@State private var scrollOffset: CGFloat = 0
@State private var frozen: Bool = false
@State private var rotation: Angle = .degrees(0)
@minhdangoz
minhdangoz / MyActivity.java
Created December 13, 2015 14:40 — forked from VladSumtsov/MyActivity.java
RecycleView PullToRefresh SwipeRefreshLayout
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.togethernetworks.basesdk.BaseActivity;
import com.togethernetworks.gallery.samples.mortar.UiModule;