Skip to content

Commit

Permalink
added Timber to build.gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
teddywilson committed Jul 10, 2017
1 parent 73618de commit f9ffe29
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ dependencies {
testCompile 'junit:junit:4.12'
compile project(':lib')
compile 'com.android.support:recyclerview-v7:25.3.0'
compile 'com.jakewharton.timber:timber:4.5.1'
}
38 changes: 38 additions & 0 deletions app/src/main/java/com/willowtreeapps/spurceexampleapp/App.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Spruce
*
* Copyright (c) 2017 WillowTree, Inc.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/

package com.willowtreeapps.spurceexampleapp;

import android.app.Application;
import timber.log.Timber;

public class App extends Application {

@Override
public void onCreate() {
super.onCreate();

if (BuildConfig.DEBUG) {
Timber.plant(new Timber.DebugTree());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.GridLayout;
import android.widget.TextView;

import com.willowtreeapps.spurceexampleapp.R;

Expand Down Expand Up @@ -61,9 +63,12 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, @Nullable
final int CHILD_VIEW_COUNT = parent.getColumnCount() * parent.getRowCount();

for (int i = 0; i < CHILD_VIEW_COUNT; i++) {
View childView = new View(getContext());
TextView childView = new TextView(getContext());
childView.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.spruceViewColor));
childView.setAlpha(0F);
childView.setTextColor(ContextCompat.getColor(getContext(), R.color.square_background));
childView.setGravity(Gravity.CENTER);
childView.setText(""+i);
parent.addView(childView);
children.add(childView);
}
Expand Down

0 comments on commit f9ffe29

Please sign in to comment.