Skip to content

Instantly share code, notes, and snippets.

View yccheok's full-sized avatar

Yan Cheng Cheok yccheok

View GitHub Profile
import UIKit
class TodoInputAccessoryView: UIView {
@IBOutlet weak var textView: UITextView!
override init(frame: CGRect) {
super.init(frame: frame)
commonInit()
}
public static ScreenDensity getScreenDensity() {
try {
final String screenDensity = MyApplication.instance().getResources().getString(R.string.screen_density);
if ("ldpi".equals(screenDensity)) {
return ScreenDensity.ldpi;
} else if ("hdpi".equals(screenDensity)) {
return ScreenDensity.hdpi;
} else if ("xhdpi".equals(screenDensity)) {
return ScreenDensity.xhdpi;
} else if ("xxhdpi".equals(screenDensity)) {
/*
* Copyright (C) 2015 Paul Burke
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
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;
@yccheok
yccheok / FadeScrollView.swift
Created March 15, 2024 03:13 — forked from luismachado/FadeScrollView.swift
Custom UIScrollView with fade effect
//
// FadeScrollView.swift
//
// Created by Luís Machado on 23/06/2017.
// Copyright © 2017 Luis Machado. All rights reserved.
//
import UIKit
class FadeScrollView: UIScrollView, UIScrollViewDelegate {
class ShopCollectionViewCell: UICollectionViewCell {
...
func collapse() {
zeroHeightConstraint.isActive = true
}
func expand() {
zeroHeightConstraint.isActive = false
}
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());
}
public static <E extends Enum<E>> void putExtra(
@NonNull Intent intent,
@NonNull String key,
@NonNull E enumValue) {
intent.putExtra(
key,
enumValue.name()
);
}
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 = "...",
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);