This file contains 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 io.github.luizgrp.sectionedrecyclerviewadapter; | |
import static io.github.luizgrp.sectionedrecyclerviewadapter.Section.State; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import androidx.annotation.LayoutRes; | |
import androidx.annotation.NonNull; |
This file contains 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
// | |
// FadeScrollView.swift | |
// | |
// Created by Luís Machado on 23/06/2017. | |
// Copyright © 2017 Luis Machado. All rights reserved. | |
// | |
import UIKit | |
class FadeScrollView: UIScrollView, UIScrollViewDelegate { |
This file contains 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
class ShopCollectionViewCell: UICollectionViewCell { | |
... | |
func collapse() { | |
zeroHeightConstraint.isActive = true | |
} | |
func expand() { | |
zeroHeightConstraint.isActive = false | |
} |
This file contains 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 enum FragmentType implements Parcelable { | |
Notes, | |
Archive, | |
Trash, | |
Backup; | |
public static final Parcelable.Creator<FragmentType> CREATOR = new Parcelable.Creator<FragmentType>() { | |
public FragmentType createFromParcel(Parcel in) { | |
return FragmentType.valueOf(in.readString()); | |
} |
This file contains 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 static <E extends Enum<E>> void putExtra( | |
@NonNull Intent intent, | |
@NonNull String key, | |
@NonNull E enumValue) { | |
intent.putExtra( | |
key, | |
enumValue.name() | |
); | |
} |
This file contains 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
A user cancelled his subscription on order id "GPA.3383-0878-7727-50427..8" on 17 December 2023 | |
Then same user subscribed again on order id "GPA.3359-8897-6679-16612" on 11 January 2024 | |
I believe he is using same product_id "cloud" and same purchase token "npmlplegcoomopcgiigbhkne.AO-J1Oz2kDBGXjy0Q0aLYyCfq4XZouWBHtQHQdbBtxIdxxBZCV1RxSoCo9AH72AosddxEmPbeJFQszl2kvJ1tAI9BxD-wqqCog" (Such a purchase token is copied from Copy purchase token button at Google Play Console) | |
When I make query using | |
androidpublisher.purchases().subscriptions().get( | |
packageName = "...", |
This file contains 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 static void expandAnimation(View view) { | |
int config_shortAnimTime = WeNoteApplication.instance().getResources().getInteger(android.R.integer.config_shortAnimTime); | |
int prevHeight = view.getHeight(); | |
// TODO: | |
int targetHeight = dpToPixel(120); | |
ValueAnimator valueAnimator = ValueAnimator.ofInt(prevHeight, targetHeight); | |
valueAnimator.setInterpolator(new AccelerateInterpolator()); | |
valueAnimator.setDuration(config_shortAnimTime); |
This file contains 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
private func _updateOrdersIfPossible2(context: NSManagedObjectContext, updateOrders: [UpdateOrder]) { | |
let count = updateOrders.count | |
if count < 2 { | |
return | |
} | |
var prevOrder = updateOrders[0].order | |
var updatedObjectIDs = [NSManagedObjectID]() |
This file contains 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
private func _updateOrdersIfPossible(context: NSManagedObjectContext, updateOrders: [UpdateOrder]) { | |
let count = updateOrders.count | |
if count < 2 { | |
return | |
} | |
var prevOrder = updateOrders[0].order | |
var updatedObjectIDs = [NSManagedObjectID]() |
This file contains 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
func getFont(_ textSize: Int) -> UIFont { | |
switch self { | |
case .new_york: | |
let sfFont = UIFont.systemFont(ofSize: CGFloat(textSize)) | |
var fontDescriptor = sfFont.fontDescriptor | |
fontDescriptor = fontDescriptor.withSymbolicTraits(.traitBold) ?? fontDescriptor | |
if let newYorkFontDescriptor = fontDescriptor.withDesign(.serif) { | |
let newYorkFont = UIFont(descriptor: newYorkFontDescriptor, size: 0.0) |
NewerOlder