Skip to content

Instantly share code, notes, and snippets.

@lawloretienne
Last active March 3, 2017 01:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lawloretienne/5535f4622e57818111db6fda4cba6e9f to your computer and use it in GitHub Desktop.
Save lawloretienne/5535f4622e57818111db6fda4cba6e9f to your computer and use it in GitHub Desktop.

Update MovieHub

  • Package by Feature
  • Dagger
  • MVP
    • The MVP Pattern is a user interface software architecture pattern that reduces the behavior of the UI components, in this case those are the views, widgets, fragments, and activities. The MVP Pattern reduces the UI components behavior to a bare minimum by using a presenter. A presenter is simply a controller like class that handles the presentation logic and updates the view accordingly. Using this pattern, you can pull your UI logic out of the Android components and place it into your presenters, making it much easier to test and much faster to test. It is faster to test since we no longer need the Android framework to test our inputs and outputs. The Android context is gone. We don't need to fire up an Android emulator or an Android device. We can just rely solely on the JVM which is very fast.
    • A repository is essentially a location where data may be stored. This can be stored in memory, on disk, in a file, in a database, or in the cloud. The repository pattern helps abstract away the implementations so you only have to worry about obtaining the data from the repository, not about the implementation details and how it's stored.
    • Add retrolambda
    • Possibly add Mapper for going from or to RealmObjects
    • Add RxUtility class for convenience methods
  • Testing
    • Mockito - Unit Tests
    • JUnit4
    • Espresso - UI Tests (Instrumentation Tests)
    • AndroidJUnitRunner
    • Functional Tests for Android Activities
    • Runner
    • Rule
    • Continuous Integration
    • Hamcrest
    • Firebase Test Lab
    • Performance Testing Codelab
    • UIAutomator (API 18+)
    • Espresso Test Recorder
    • Monkeyrunnder
      • ./adb -d shell monkey -p com.android.clvb -v 20000
    • OkHttp Mocking
    • OkHttp MockWebserver
    • TestMethod Naming Conventions
      • methodName_CodePathExplanation
      • methodName_StateUnderTest_ExpectedBehavior
      • methodName_InputValues_ExpectedBehavior
      • methodName_WithCertainState_ShouldDoSomething
      • methodName_WhenXX_ExpectYY
    • TestClass Naming Conventions
      • NameOfTheClassUnderTestTests
    • TDD
      • Red, Green, Refactor
      • Make test fail, then make test pass, then refactor any code that may need to be cleaned up at that point.
    • Steps to writing a test
      • Set up the conditions required for the test
      • Then perform one or more actions
      • Afterwards, verify that the state you are expecting is actually achieved
    • Mocks and Stubs
      • Mocks provide the ability to test for interactions
      • Stubs provide data

Camera App

  • ViewPager w/ 2 Fragments
  • Camera2Basic and Camera2Video
  • ViewPagerPageTransformation
  • googlesamples github

Custom Circle Indicator

  • Google Camera & Ink Page Indicator

Look into @Nullable & @NotNull

  • @Nullable helps with lint analysis during compilation and during Android lint execution

CircleImageView w/ RoundedBitmapDrawable

  • RoundedRect & Circle

QuiltLayoutManager

  • StaggeredGridLayoutManager
  • Layout Span
  • DynamicHeightImageView
GridLayoutManager.SpanSizeLookup spanSizeLookup = new GridLayoutManager.SpanSizeLookup() {
    @Override
    public int getSpanSize(int position){
      if(position % 4 == 0){
        return 3;
      } else {
        return 1;
      }
    }
}

Cache-Control

  • (max-age=60)

RxBus

  • Change from PublishSubject to BehaviorSubject

Unsplash Client

Resource id naming

  • feature_header
  • feature_subtitle
  • feature_title
  • feature_description

Analytics

  • Use Answers to track page views

A/B Testing

  • Custom config API because 3rd party solutions are too expensive
  • Config API returns a JSON response of A/B tests and variants
  • www.leanplum.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment