Skip to content
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.

Commit

Permalink
Improve style consistency with AOSP
Browse files Browse the repository at this point in the history
Also unify copyright
  • Loading branch information
keyboardsurfer committed Sep 24, 2015
1 parent 8832dca commit ec66d1c
Show file tree
Hide file tree
Showing 185 changed files with 3,577 additions and 2,983 deletions.
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
This sample uses the following software:

Copyright 2015 The Android Open Source Project
Copyright 2015 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.helper;

import android.support.test.runner.AndroidJUnit4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.helper;

import android.os.Parcel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.helper;

import android.content.Context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.model;

import android.os.Parcel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.model;

import android.os.Parcel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.model.quiz;

import android.os.Parcel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.model.quiz;

public class AlphaPickerQuizTest extends AbsQuizTestCase<AlphaPickerQuiz> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.model.quiz;

public class FillBlankQuizTest extends AbsQuizTestCase<FillBlankQuiz> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.model.quiz;

public class FillTwoBlanksQuizTest extends AbsQuizTestCase<FillTwoBlanksQuiz> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.model.quiz;

public class FourQuarterQuizTest extends AbsQuizTestCase<FourQuarterQuiz> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.model.quiz;

public class MultiSelectQuizTest extends AbsQuizTestCase<MultiSelectQuiz> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.model.quiz;

public class PickerQuizTest extends AbsQuizTestCase<PickerQuiz> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.model.quiz;

public class SelectItemQuizTest extends AbsQuizTestCase<SelectItemQuiz> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.model.quiz;

public class ToggleTranslateQuizTest extends AbsQuizTestCase<ToggleTranslateQuiz> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.model.quiz;

public class TrueFalseQuizTest extends AbsQuizTestCase<TrueFalseQuiz> {
Expand Down
6 changes: 2 additions & 4 deletions app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2015 Google Inc.
~
Expand All @@ -15,9 +14,8 @@
~ limitations under the License.
-->

<manifest
xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- speed up app deployment in debug mode -->
<application android:vmSafeMode="true"
android:allowBackup="false" />
android:allowBackup="false" />
</manifest>
34 changes: 14 additions & 20 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2015 Google Inc.
~
Expand All @@ -15,34 +14,29 @@
~ limitations under the License.
-->

<manifest
package="com.google.samples.apps.topeka"
xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.samples.apps.topeka">

<application
android:allowBackup="false"
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="false"
android:theme="@style/Topeka">
<application android:allowBackup="false"
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="false"
android:theme="@style/Topeka">

<activity
android:name=".activity.SignInActivity"
android:windowSoftInputMode="adjustPan">
<activity android:name=".activity.SignInActivity"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".activity.CategorySelectionActivity"
android:theme="@style/Topeka.CategorySelectionActivity" />
<activity android:name=".activity.CategorySelectionActivity"
android:theme="@style/Topeka.CategorySelectionActivity" />

<activity
android:name=".activity.QuizActivity"
android:windowSoftInputMode="adjustPan" />
<activity android:name=".activity.QuizActivity"
android:windowSoftInputMode="adjustPan" />

</application>
</manifest>
1 change: 1 addition & 0 deletions app/src/main/java/android/util/IntProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package android.util;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.adapter;

import android.app.Activity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.adapter;

import android.widget.ImageView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.adapter;

import android.content.Context;
Expand Down Expand Up @@ -54,8 +55,8 @@ public OptionsQuizAdapter(String[] options, @LayoutRes int layoutId) {
* @param context The context for the adapter.
* @param withPrefix True if a prefix should be given to all items.
*/
public OptionsQuizAdapter(String[] options, @LayoutRes int layoutId, Context context,
boolean withPrefix) {
public OptionsQuizAdapter(String[] options, @LayoutRes int layoutId,
Context context, boolean withPrefix) {
mOptions = options;
mLayoutId = layoutId;
if (withPrefix) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.adapter;

import android.content.Context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.adapter;

import android.content.Context;
Expand Down Expand Up @@ -119,7 +120,7 @@ private Drawable getFailedIcon(Context context) {
* @return The tinted drawable.
*/
private Drawable loadAndTint(Context context, @DrawableRes int drawableId,
@ColorRes int tintColor) {
@ColorRes int tintColor) {
Drawable imageDrawable = ContextCompat.getDrawable(context, drawableId);
if (imageDrawable == null) {
throw new IllegalArgumentException("The drawable with id " + drawableId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static CategorySelectionFragment newInstance() {

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_categories, container, false);
}

Expand Down Expand Up @@ -73,7 +73,7 @@ public void onResume() {
}

private void startQuizActivityWithTransition(Activity activity, View toolbar,
Category category) {
Category category) {

final Pair[] pairs = TransitionHelper.createSafeTransitionParticipants(activity, false,
new Pair<>(toolbar, activity.getString(R.string.transition_toolbar)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.fragment;

import android.os.Bundle;
Expand Down Expand Up @@ -56,7 +57,7 @@ public class QuizFragment extends android.support.v4.app.Fragment {
private SolvedStateListener mSolvedStateListener;

public static QuizFragment newInstance(String categoryId,
SolvedStateListener solvedStateListener) {
SolvedStateListener solvedStateListener) {
if (categoryId == null) {
throw new IllegalArgumentException("The category can not be null");
}
Expand All @@ -79,7 +80,7 @@ public void onCreate(Bundle savedInstanceState) {

@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
@Nullable Bundle savedInstanceState) {
// Create a themed Context and custom LayoutInflater
// to get nicely themed views in this Fragment.
final Theme theme = mCategory.getTheme();
Expand Down Expand Up @@ -165,8 +166,7 @@ private void restoreQuizState(final Bundle savedInstanceState) {
mQuizView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom,
int oldLeft,
int oldTop, int oldRight, int oldBottom) {
int oldLeft, int oldTop, int oldRight, int oldBottom) {
mQuizView.removeOnLayoutChangeListener(this);
View currentChild = mQuizView.getChildAt(0);
if (currentChild instanceof ViewGroup) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ public void onCreate(Bundle savedInstanceState) {

@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
@Nullable Bundle savedInstanceState) {
final View contentView = inflater.inflate(R.layout.fragment_sign_in, container, false);
contentView.addOnLayoutChangeListener(new View.
OnLayoutChangeListener() {
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom,
int oldLeft, int oldTop, int oldRight, int oldBottom) {
int oldLeft, int oldTop, int oldRight, int oldBottom) {
v.removeOnLayoutChangeListener(this);
setUpGridView(getView());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.helper;

import android.util.Log;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.helper;

import android.util.Log;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.helper;

import android.os.Parcel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.samples.apps.topeka.helper;

import android.content.Context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ public class TransitionHelper {
*
* @param activity The activity used as start for the transition.
* @param includeStatusBar If false, the status bar will not be added as the transition
* participant.
* participant.
* @return All transition participants.
*/
public static Pair[] createSafeTransitionParticipants(@NonNull Activity activity,
boolean includeStatusBar, @Nullable Pair... otherParticipants) {
boolean includeStatusBar,
@Nullable Pair... otherParticipants) {
// Avoid system UI glitches as described here:
// https://plus.google.com/+AlexLockwood/posts/RPtwZ5nNebb
View decor = activity.getWindow().getDecorView();
Expand Down
Loading

0 comments on commit ec66d1c

Please sign in to comment.