This file contains hidden or 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 PathUtils { | |
| /** | |
| * To get URI from Path | |
| * | |
| * @param context context | |
| * @param file file | |
| * @return Uri | |
| */ | |
| public static Uri getUriFromPath(Context context, File file) { | |
| String filePath = file.getAbsolutePath(); |
This file contains hidden or 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
| import SwiftUI | |
| struct ToastView: View { | |
| @State private var liked: Bool = false | |
| var body: some View { | |
| VStack { | |
| LikeButton(liked: $liked) | |
| } | |
| .toast(isShowing: $liked, text: Text("Hello toast!")) |
This file contains hidden or 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
| import SwiftUI | |
| extension View { | |
| func eraseToAnyView() -> AnyView { | |
| AnyView(self) | |
| } | |
| } | |
| struct SizePreferenceKey: PreferenceKey { | |
| typealias Value = CGSize |
This file contains hidden or 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
| // | |
| // View+Geometry.swift | |
| // SwiftUIKit | |
| // | |
| // Created by Daniel Saidi on 2020-03-26. | |
| // Copyright © 2020 Daniel Saidi. All rights reserved. | |
| // | |
| import SwiftUI |
This file contains hidden or 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
| struct ExpandableButtonPanel: View { | |
| let primaryItem: ExpandableButtonItem | |
| let secondaryItems: [ExpandableButtonItem] | |
| private let noop: () -> Void = {} | |
| private let size: CGFloat = 70 | |
| private var cornerRadius: CGFloat { | |
| get { size / 2 } | |
| } |
This file contains hidden or 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
| import SwiftUI | |
| import Combine | |
| public struct ChangeObserver<V: Equatable>: ViewModifier { | |
| public init(newValue: V, action: @escaping (V) -> Void) { | |
| self.newValue = newValue | |
| self.newAction = action | |
| } | |
| private typealias Action = (V) -> Void |
This file contains hidden or 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.your.package.name; | |
| import android.app.Activity; | |
| import com.anjlab.android.iab.v3.BillingProcessor; | |
| // This singleton class is designed to fix this issue: https://github.com/anjlab/android-inapp-billing-v3/issues/503 | |
| // the solution is based on this suggestion: https://github.com/anjlab/android-inapp-billing-v3/issues/501#issuecomment-962612355 | |
| public class BillingHolder { |
OlderNewer