- http://stackoverflow.com/questions/804115 (
rebase
vsmerge
). - https://www.atlassian.com/git/tutorials/merging-vs-rebasing (
rebase
vsmerge
) - https://www.atlassian.com/git/tutorials/undoing-changes/ (
reset
vscheckout
vsrevert
) - http://stackoverflow.com/questions/2221658 (HEAD^ vs HEAD~) (See
git rev-parse
) - http://stackoverflow.com/questions/292357 (
pull
vsfetch
) - http://stackoverflow.com/questions/39651 (
stash
vsbranch
) - http://stackoverflow.com/questions/8358035 (
reset
vscheckout
vsrevert
)
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
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.ExperimentalCoroutinesApi | |
import kotlinx.coroutines.flow.MutableStateFlow | |
import kotlinx.coroutines.flow.collect | |
import kotlinx.coroutines.flow.filterNotNull | |
import kotlinx.coroutines.flow.launchIn | |
import kotlinx.coroutines.flow.onEach | |
@ExperimentalCoroutinesApi | |
class FeedViewModel @AssistedInject constructor( |
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 RecyclerView mRecyclerView; | |
@Nullable | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
View view = inflater.inflate(R.layout.fragment_view, container, false); | |
mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view); | |
// ommiting other recycler view set up, such as adapter and Layout manager set up .. | |
ViewTreeObserver viewTreeObserver = mRecyclerView.getViewTreeObserver(); | |
viewTreeObserver.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { |
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
## I just ran into this after initializing a Visual Studio project _before_ adding a .gitignore file (like an idiot). | |
## I felt real dumb commiting a bunch of files I didn't need to, so the commands below should do the trick. The first two commands | |
## came from the second answer on this post: http://stackoverflow.com/questions/7527982/applying-gitignore-to-committed-files | |
# See the unwanted files: | |
git ls-files -ci --exclude-standard | |
# Remove the unwanted files: | |
git ls-files -ci --exclude-standard -z | xargs -0 git rm --cached |
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
/** | |
* Our demo fragment | |
*/ | |
public static class CircularRevealingFragment extends Fragment { | |
OnFragmentTouched listener; | |
public CircularRevealingFragment() { | |
} |
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
/* | |
* 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 |
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
import com.android.volley.TimeoutError; | |
import com.android.volley.VolleyError; | |
import com.android.volley.Request; | |
import com.android.volley.Response; | |
import com.android.volley.toolbox.JsonObjectRequest; | |
import org.json.JSONObject; | |
Response.Listener<JSONObject> successListener = new Response.Listener<JSONObject>() { |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
Steps to make a Fragment or View to have a Callback to its parent Activity.
Step by step from info taken from here:
http://developer.android.com/guide/components/fragments.html#CommunicatingWithActivity
- We have an Activity that hosts a Fragment or a View
- We have a Fragment or View with a ListView or a Button or some element that we want the Activity to know about. i.e. we load detailed info of an element chosen on a ListView or something.
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
/** | |
* Returns the Uri which can be used to delete/work with images in the photo gallery. | |
* @param filePath Path to IMAGE on SD card | |
* @return Uri in the format of... content://media/external/images/media/[NUMBER] | |
*/ | |
private Uri getUriFromPath(String filePath) { | |
long photoId; | |
Uri photoUri = MediaStore.Images.Media.getContentUri("external"); | |
String[] projection = {MediaStore.Images.ImageColumns._ID}; |
NewerOlder