Skip to content

Instantly share code, notes, and snippets.

View nasrabadiAM's full-sized avatar

Ali Nasrabadi nasrabadiAM

View GitHub Profile
@nasrabadiAM
nasrabadiAM / Text.java
Created January 27, 2019 19:27
Fix Single Responsibility Principle
class Text {
String text;
String author;
int length;
String getText() { ... }
void setText(String s) { ... }
String getAuthor() { ... }
void setAuthor(String s) { ... }
int getLength() { ... }
@nasrabadiAM
nasrabadiAM / git-patch.md
Last active April 17, 2019 05:34
git patch against master

git format-patch master --stdout > fix_empty_poster.patch

@nasrabadiAM
nasrabadiAM / git-apply-patch.md
Created April 17, 2019 05:31
git apply patch

git apply --stat fix_empty_poster.patch

@nasrabadiAM
nasrabadiAM / bug-report-template.md
Created May 6, 2019 05:52
Bug report template

Issue(bug report) Template:

  • This a template to report an issue.

When reporting a bug:

Fill out the sections below, leaving the headers but replacing the content. If you're unable to provide certain information, please explain why in the relevant section. We may close issues if they do not include sufficient information.

@nasrabadiAM
nasrabadiAM / NestedCoordinatorLayout.kt
Last active March 10, 2020 08:22
Having multiple point scrollFlags for CoordinatorLayout and appbars. link: https://stackoverflow.com/a/60613726/8743629
package com.nasrabadiam.widget
import android.content.Context
import android.util.AttributeSet
import android.view.View
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.view.NestedScrollingChild
import androidx.core.view.NestedScrollingChildHelper
class NestedCoordinatorLayout @JvmOverloads constructor(
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@nasrabadiAM
nasrabadiAM / inner_viewpager2.xml
Last active April 13, 2020 08:02
Inner ViewPager2 XML File
<androidx.coordinatorlayout.widget.CoordinatorLayout>
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar">
<com.google.android.material.tabs.TabLayout
android:id="@+id/chipsLayout" />