Skip to content

Instantly share code, notes, and snippets.

View OyaCanli's full-sized avatar

Oya Canli OyaCanli

  • Belgium
View GitHub Profile
@OyaCanli
OyaCanli / syncYourFork.md
Last active January 3, 2019 21:20
How to sync your fork when collaborating on github

When you want to collaborate on a project for the first time, you fork the project and then clone your fork to your PC. When you clone a repo from github, it automatically adds that address as a remote address for your local project and when you later call git push, it pushes your changes to that remote (which is your fork on github, and which is by convention named as origin). If you call git remote -v at this stage on git bash/command you'll see the address of your own fork as remote origin(both for pulling and pushing)

However, when there is a change in the original repo that you forked, the changes won't be reflected in your local copy, neither in your fork on github. It doesn't help to call git pull or press update on AS, because the default destination for updating is your fork on github, which is not updated either.

So, you need to fetch directly from the original repo that you forked. For this, you need to add it as a second remote address.

@OyaCanli
OyaCanli / selector
Created January 2, 2018 16:56
selector with drawables defined inside
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:id="@+id/buttonSelected">
<shape android:shape="rectangle">
<solid android:color="@color/background"/>
<stroke android:width="4dp" android:color="@color/background"/>
<corners android:radius="10dp" />
</shape>
</item>
<item android:state_checked="true" android:id="@+id/buttonNotSelected">