Getting Git: Stash Some the Things

Getting Git: Stash Some the Things

I am a consummate git stash addict and use it daily.

I am also decidedly not a git expert by any measure.

Often (too often) I have wondered how I could stash only some of the changes in my working directory. Recently, I actually RTFM and discovered a couple of ways. Woohoo!

  1. git stash --keep-index
  2. git stash --patch

As usual, you are now free to go, dear reader. For a little more discussion, please continue.

Things You May Not Know: Tools Attributes

Things You May Not Know: Tools Attributes

You may have seen an extra namespace, xmlns:tools="http://schemas.android.com.tools", in layout files generated by Android Studio. Adding this namespace to your layout provides you access to attributes, the Tools Attributes, that add metadata to resource files, that facilitate manipulating, rendering, and testing layouts in Design view, and (while I do not condone excess of this kind of behavior) that suppress certain Lint warnings (but only if you have a good reason for ignoring them, she nags). 

Things You May Not Know: onResumeFragments

Things You May Not Know: onResumeFragments

The long and short of it: if you are using any subclass of FragmentActivity (like the new AppCompatActivity) and you are thinking of doing any kind of fragment transaction in onResume, do it in onResumeFragments.

If you feel like some detail and some caveats, read on. If not, no worries. Have a good one and see you next post.

Hunting Unused Android Resources with Lint

Hunting Unused Android Resources with Lint

I love Lint. I love Lint because it mocks me. Lint mocks me with little yellow markers pointing out questionable code that I need to tidy, and being on the OCD-ish side, I do that.

Lint can also generate a full warnings and errors report. The report can be (and depending on your code base, often is) overwhelming, but a fairly straightforward-to-find section is the "Unused Resources". Unused resources (layouts, strings, colors, drawables, etc.) bloat the application and slow down builds. So obviously, these jerks have got to go.