Skip to content

Instantly share code, notes, and snippets.

View pishguy's full-sized avatar
✍️
Focusing

Mahdi Pishguy pishguy

✍️
Focusing
View GitHub Profile
/*
* Copyright (C) 2014 skyfish.jy@gmail.com
*
* 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
@pishguy
pishguy / EndlessListActivity.java
Created September 21, 2017 08:16 — forked from pratamawijaya/EndlessListActivity.java
Android Endless Scroll using RecyclerView
public class EndlessListActivity<D> extends Activity {
private EndlessRecyclerOnScrollListener mEndlessScrollListener;
private EndlessListAdapter mAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
RecyclerView listView = (RecyclerView) findViewById(R.id.list);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
@pishguy
pishguy / TextHighlight.java
Created September 21, 2017 08:19 — forked from pratamawijaya/TextHighlight.java
TextHighlight.java
// digunakan untuk Highlight text yang sedang dicari
private void setColor(TextView view, String fulltext, String subtext, int color) {
view.setText(fulltext, TextView.BufferType.SPANNABLE);
Spannable str = (Spannable) view.getText();
int i = fulltext.indexOf(subtext);
str.setSpan(new ForegroundColorSpan(color), i, i + subtext.length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
@pishguy
pishguy / MainActivity.java
Created April 16, 2020 18:12 — forked from slightfoot/MainActivity.java
Transparent Navigation in #Flutter App. 13th May 2019
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
public class MainActivity extends FlutterActivity
import 'dart:math';
import 'dart:ui';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/physics.dart';
import 'package:flutter/scheduler.dart';
void main() {
// debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia;