Giter Club home page Giter Club logo

topeka's Introduction

Topeka for Android

A fun to play quiz that showcases material design on Android

Introduction

Material design is a new system for visual, interaction and motion design. The Android version of Topeka demonstrates that the same branding and material design principles can be used to create a consistent experience across platforms.

We originally launched the Topeka web app as an Open Source example of material design on the web.

The current release of Topeka is available to users down to API level 14 aka Ice Cream Sandwich. This is being accomplished by utilizing several support libraries. Especially AppCompat and the design support library play important roles.

Topeka also features a set of Espresso tests which can be executed with the connectedAndroidTest gradle task.

You can read more about the project on the Android Developers blog.

Screenshots

Getting Started

Clone this repository, enter the top level directory and run ./gradlew tasks to get an overview of all the tasks available for this project.

Some important tasks are:

bundleDebug - Assembles all Debug builds.
installDebug - Installs the Debug build.
connectedAndroidTest - Installs and runs the tests for Debug build on connected
devices.
test - Run all unit tests.

Support

If you've found an error in this sample, please file an issue:

https://github.com/googlesamples/android-topeka/issues

Patches are encouraged, and may be submitted by forking this project and submitting a pull request through GitHub.

License

Copyright 2015 Google, Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for
additional information regarding copyright ownership. The ASF licenses this
file to you 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
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.

topeka's People

Contributors

alxrm avatar anikiki avatar appoll avatar ardock avatar ceruleanotter avatar cketti avatar codingjeremy avatar dimorinny avatar georgcantor avatar ggfan avatar keyboardsurfer avatar liutikas avatar maxme avatar naokigoogle avatar owahltinez avatar piotrek1543 avatar ryanseys avatar shchurov avatar shreyashpromact avatar subhrajyotisen avatar tjohns avatar wojtek-kalicinski avatar yaraki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

topeka's Issues

topeka crashs

06-18 16:29:26.778  29605-29605/com.google.samples.apps.topeka W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41cecc08)
06-18 16:29:26.778  29605-29605/com.google.samples.apps.topeka E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: com.google.samples.apps.topeka, PID: 29605
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.samples.apps.topeka/com.google.samples.apps.topeka.activity.SignInActivity}: android.view.InflateException: Binary XML file line #17: Error inflating class com.google.samples.apps.topeka.widget.fab.DoneFab
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2413)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
            at android.app.ActivityThread.access$900(ActivityThread.java:175)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:146)
            at android.app.ActivityThread.main(ActivityThread.java:5603)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: android.view.InflateException: Binary XML file line #17: Error inflating class com.google.samples.apps.topeka.widget.fab.DoneFab
            at android.view.LayoutInflater.createView(LayoutInflater.java:626)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702)
            at android.view.LayoutInflater.parseInclude(LayoutInflater.java:827)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:751)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:769)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
            at com.google.samples.apps.topeka.fragment.SignInFragment.onCreateView(SignInFragment.java:68)
            at android.app.Fragment.performCreateView(Fragment.java:1700)
            at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890)
            at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
            at android.app.BackStackRecord.run(BackStackRecord.java:684)
            at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1453)
            at android.app.Activity.performStart(Activity.java:5467)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2386)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
            at android.app.ActivityThread.access$900(ActivityThread.java:175)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:146)
            at android.app.ActivityThread.main(ActivityThread.java:5603)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.reflect.InvocationTargetException
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
            at android.view.LayoutInflater.createView(LayoutInflater.java:600)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702)
            at android.view.LayoutInflater.parseInclude(LayoutInflater.java:827)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:751)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:769)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
            at com.google.samples.apps.topeka.fragment.SignInFragment.onCreateView(SignInFragment.java:68)
            at android.app.Fragment.performCreateView(Fragment.java:1700)
            at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890)
            at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
            at android.app.BackStackRecord.run(BackStackRecord.java:684)
            at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1453)
            at android.app.Activity.performStart(Activity.java:5467)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2386)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
            at android.app.ActivityThread.access$900(ActivityThread.java:175)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:146)
            at android.app.ActivityThread.main(ActivityThread.java:5603)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.NoClassDefFoundError: com.google.samples.apps.topeka.widget.outlineprovider.FabOutlineProvider
            at com.google.samples.apps.topeka.widget.fab.FloatingActionButton.<init>(FloatingActionButton.java:46)
            at com.google.samples.apps.topeka.widget.fab.DoneFab.<init>(DoneFab.java:34)
            at com.google.samples.apps.topeka.widget.fab.DoneFab.<init>(DoneFab.java:30)
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
            at android.view.LayoutInflater.createView(LayoutInflater.java:600)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702)
            at android.view.LayoutInflater.parseInclude(LayoutInflater.java:827)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:751)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:769)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
            at com.google.samples.apps.topeka.fragment.SignInFragment.onCreateView(SignInFragment.java:68)
            at android.app.Fragment.performCreateView(Fragment.java:1700)
            at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890)
            at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
            at android.app.BackStackRecord.run(BackStackRecord.java:684)
            at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1453)
            at android.app.Activity.performStart(Activity.java:5467)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2386)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
            at android.app.ActivityThread.access$900(ActivityThread.java:175)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:146)
            at android.app.ActivityThread.main(ActivityThread.java:5603)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
            at dalvik.system.NativeStart.main(Native Method)

OutOfMemoryError

Crash in open the app.
Device: Nexus 6
Android version: 5.1.0

06-17 10:36:25.204    6023-6023/com.google.samples.apps.topeka E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: com.google.samples.apps.topeka, PID: 6023
    java.lang.OutOfMemoryError: Failed to allocate a 5017612 byte allocation with 2124244 free bytes and 2MB until OOM
            at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
            at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
            at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:609)
            at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)
            at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:988)
            at android.content.res.Resources.loadDrawableForCookie(Resources.java:2474)
            at android.content.res.Resources.loadDrawable(Resources.java:2381)
            at android.content.res.Resources.getDrawable(Resources.java:787)
            at android.content.Context.getDrawable(Context.java:403)
            at android.widget.ImageView.resolveUri(ImageView.java:747)
            at android.widget.ImageView.setImageResource(ImageView.java:398)
            `at com.google.samples.apps.topeka.adapter.AvatarAdapter.setAvatar(AvatarAdapter.java:52)`
            `at com.google.samples.apps.topeka.adapter.AvatarAdapter.getView(AvatarAdapter.java:47)`
            at android.widget.AbsListView.obtainView(AbsListView.java:2347)
            at android.widget.GridView.makeAndAddView(GridView.java:1433)
            at android.widget.GridView.makeRow(GridView.java:361)
            at android.widget.GridView.fillDown(GridView.java:302)
            at android.widget.GridView.fillFromTop(GridView.java:437)
            at android.widget.GridView.layoutChildren(GridView.java:1276)
            at android.widget.AbsListView.onLayout(AbsListView.java:2151)
            at android.view.View.layout(View.java:15671)
            at android.view.ViewGroup.layout(ViewGroup.java:5038)
            at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
            at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
            at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
            at android.view.View.layout(View.java:15671)
            at android.view.ViewGroup.layout(ViewGroup.java:5038)
            at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
            at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
            at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
            at android.view.View.layout(View.java:15671)
            at android.view.ViewGroup.layout(ViewGroup.java:5038)
            at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
            at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
            at android.view.View.layout(View.java:15671)
            at android.view.ViewGroup.layout(ViewGroup.java:5038)
            at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
            at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
            at android.view.View.layout(View.java:15671)
            at android.view.ViewGroup.layout(ViewGroup.java:5038)
            at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
            at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
            at android.view.View.layout(View.java:15671)
            at android.view.ViewGroup.layout(ViewGroup.java:5038)
            at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
            at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
            at android.view.View.layout(View.java:15671)
            at android.view.ViewGroup.layout(ViewGroup.java:5038)
            at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
            at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
            at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
            at android.view.View.layout(View.java:15671)
            at android.view.ViewGroup.layout(ViewGroup.java:5038)
            at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
            at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
            at android.view.View.layout(View.java:15671)
            at android.view.ViewGroup.layout(ViewGroup.java:5038)
            at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2114)
            at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1843)
            at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1061)
            at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5885)
            at android.view.Choreographer$CallbackRecord.run(

NPE on instant run on login screen

Using 1d973e8 :

Upgrade plugin to 2.0.0-alpha1+

Launch topeka, edit first_name string resource, then hit "instant run":

App will crash with:

java.lang.NullPointerException: Attempt to invoke virtual method 'int com.google.samples.apps.topeka.model.Avatar.ordinal()' on a null object reference
at com.google.samples.apps.topeka.fragment.SignInFragment.onSaveInstanceState(SignInFragment.java:96)
at android.support.v4.app.Fragment.performSaveInstanceState(Fragment.java:2109)
at android.support.v4.app.FragmentManagerImpl.saveFragmentBasicState(FragmentManager.java:1767)
at android.support.v4.app.FragmentManagerImpl.saveAllState(FragmentManager.java:1835)
at android.support.v4.app.FragmentController.saveAllState(FragmentController.java:125)
at android.support.v4.app.FragmentActivity.onSaveInstanceState(FragmentActivity.java:523)
at android.app.Activity.performSaveInstanceState(Activity.java:1298)
at android.app.Instrumentation.callActivityOnSaveInstanceState(Instrumentation.java:1289)
at android.app.ActivityThread.callCallActivityOnSaveInstanceState(ActivityThread.java:4088)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4050)
at android.app.ActivityThread.-wrap15(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1350)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616

oom exception

1607-1607/com.google.samples.apps.topeka E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.google.samples.apps.topeka, PID: 1607
java.lang.OutOfMemoryError: Failed to allocate a 5017612 byte allocation with 2124476 free bytes and 2MB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:609)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:988)
at android.content.res.Resources.loadDrawableForCookie(Resources.java:2474)
at android.content.res.Resources.loadDrawable(Resources.java:2381)
at android.content.res.Resources.getDrawable(Resources.java:787)
at android.content.Context.getDrawable(Context.java:403)
at android.widget.ImageView.resolveUri(ImageView.java:747)
at android.widget.ImageView.setImageResource(ImageView.java:398)
at com.google.samples.apps.topeka.adapter.AvatarAdapter.setAvatar(AvatarAdapter.java:52)
at com.google.samples.apps.topeka.adapter.AvatarAdapter.getView(AvatarAdapter.java:47)
at android.widget.AbsListView.obtainView(AbsListView.java:2347)
at android.widget.GridView.makeAndAddView(GridView.java:1433)
at android.widget.GridView.makeRow(GridView.java:361)
at android.widget.GridView.fillDown(GridView.java:302)
at android.widget.GridView.fillFromTop(GridView.java:437)
at android.widget.GridView.layoutChildren(GridView.java:1276)
at android.widget.AbsListView.onLayout(AbsListView.java:2151)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2114)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1843)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1061)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5885)
at android.view.Choreographer$CallbackRecord.run(

device: genymotion nexus6 5.1

[Improvement] Uppercase user answer than check with correct one

Hi,

I've already played Topeka game and I noticed that if I answer the question with lowercase letters like "texas" when correct is "Texas" it returns false and no points.

Could you make a small change in code to make every first letter of user answer capital?

Cheers.

Sometimes crash on back press from test

Device: Nexus 4
Android version: 5.1.1

06-17 10:35:06.099 10078-10078/com.google.samples.apps.topeka E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.google.samples.apps.topeka, PID: 10078
java.lang.NullPointerException: Attempt to read from field 'android.os.Handler android.app.Activity.mHandler' on a null object reference
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1427)
at android.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:483)
at android.app.FragmentManagerImpl.popBackStackImmediate(FragmentManager.java:498)
at android.app.Activity.onBackPressed(Activity.java:2482)
at com.google.samples.apps.topeka.activity.QuizActivity.access$201(QuizActivity.java:42)
at com.google.samples.apps.topeka.activity.QuizActivity$2.onAnimationEnd(QuizActivity.java:127)
at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1116)
at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1171)
at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:722)
at android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:738)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.Choreographer.doFrame(Choreographer.java:549)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

Score and answer items text appearance need be fixed for pre-lollipop devices

Lint detects usage of v21 resources on pre-lollipop devices:

  1. Animators using interpolators only used on v21, can be moved to animator-v21.
  2. Same for transitions, only used on v21, can be moved to transitions-v21 to avoid lint errors.
  3. List items need to use Appcompat, currently using Material Theme only avalaible on API 21+.
    cb3b
    bc3c

Used here:
bc3

Solution for ListItem:
bc3d
bc3e

Workaround for ListItemSecondary, currently not included in AppCompat, use directly Body1:
bc3f

Clicking submit multiple times submits answers before questions could be seen

If you answer a question and then press the submit button two or three times, the app quickly performs the transition multiple times (looks pretty jumpy), several questions get answered (which is definitely not intended), and then sometimes the submit button's icon (either a cross or a checkmark) is rotated and / or skewed.

Like this:
screenshot_2015-10-28-23-53-54

Start Activity

hi,
first,tnx for new version(Support pre-lolipop)
second,how i can start blank activity(for example about activity) when user click one of the categories?

SignInFragment (gridView.getChildat) can return incorrect views or produce a NPE

The child views are recycled and not all are visible when using a gridView.

To reproduce a NPE, select the last avatar, rotate to landscape mode and press the fab button.
The childCount will be (using a nexus 5) 11 and the avatar.ordinal 16.

The issue is in this line and a better explanation and solution here and here.

java.lang.IllegalArgumentException: Shared element must not be null
  at android.app.ActivityOptions.makeSceneTransitionAnimation(ActivityOptions.java:561)
  at android.support.v4.app.ActivityOptionsCompat21.makeSceneTransitionAnimation(ActivityOptionsCompat21.java:45)
  at android.support.v4.app.ActivityOptionsCompat.makeSceneTransitionAnimation(ActivityOptionsCompat.java:171)
  at com.google.samples.apps.topeka.fragment.SignInFragment.performSignInWithTransition(SignInFragment.java:224)
  at com.google.samples.apps.topeka.fragment.SignInFragment.access$800(SignInFragment.java:48)
  at com.google.samples.apps.topeka.fragment.SignInFragment$3$1.run(SignInFragment.java:172)
  at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1119)
  at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1239)
  at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:766)
  at android.animation.ValueAnimator$AnimationHandler$1.run(ValueAnimator.java:801)
  at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
  at android.view.Choreographer.doCallbacks(Choreographer.java:670)
  at android.view.Choreographer.doFrame(Choreographer.java:603)
  at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
  at android.os.Handler.handleCallback(Handler.java:739)
  at android.os.Handler.dispatchMessage(Handler.java:95)
  at android.os.Looper.loop(Looper.java:148)
  at android.app.ActivityThread.main(ActivityThread.java:5417)
  at java.lang.reflect.Method.invoke(Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  11-30 13:26:37.409 28287-28287/com.google.samples.apps.topeka I/Process: Sending signal. PID: 28287 SIG: 9

Find a memory leak with TopekaDatabaseHelper

I combined this project with LeakCanary,and find a memory leak, here are the details:

  • com.google.samples.apps.topeka.activity.CategorySelectionActivity has leaked:
  • GC ROOT static com.google.samples.apps.topeka.persistence.TopekaDatabaseHelper.mInstance
  • references com.google.samples.apps.topeka.persistence.TopekaDatabaseHelper.mContext
  • leaks com.google.samples.apps.topeka.activity.CategorySelectionActivity instance

And I don't know how to fix it...

How to change the questions?

Which classes I can change the questions that I want? How can I do that? I am reading the classes but not idea yet

QuizActivity transition is not smooth

Hoping to get some direction on how to fix issues like this. I often see this type of flickering and misaligned animations when using ActivityOptions to pass views.

Imgur

You can add this to QuizActivity.onCreate(), but it only stops the status bar/nav bar flickering (and not the misaligned views). It's also a nasty little block of code that shouldn't be necessary everywhere, and I'm hoping there's a better way.

postponeEnterTransition();

final View decor = getWindow().getDecorView();
decor.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
    @Override
    public boolean onPreDraw() {
        decor.getViewTreeObserver().removeOnPreDrawListener(this);
        startPostponedEnterTransition();
        return true;
    }
});

Compiling Topeka in Android Studio

Hello Developers..Could any one help me with the necessary steps to compile topeka because i get an error that the project doesnot use the graddle build system

Floating label overlaps username last initial on S2 API 19 (4.4.4)

Floating label for TextInputLayout overlaps last initial on S2 API 4.4.4

screenshot_2015-11-04-08-31-58

and the hint is too close to the text field divider.

screenshot_2015-11-04-08-31-46

I don't know the best way to fix it but I solved it deleting the paddinTop and paddingBottom on both TextInputLayouts.

I tested this change on that device and confirmed that nexus5 and nexus7 still look good.
I can not test it on other devices due to either are not supported or the screen size is greater and are not affected.

Optionally I tried to follow the Material Design Spec ,like reducing text size to 16sp as recommended, it helped but it didn't solve the issue.

I can pull request the padding deletion but would be better that someone check it on more devices or propose a better solution. I'm not familiar with this new view.

Replacing images

I am trying to replace the images in drawable. I am not being able, cause I choose new images and rename them, when I compile the project the images keep the same. Any help? I already tried clean and rebuild the project.

<> Problem

Hello,

I need help. I imported this project on android studio and after this i try to run but Android Studio showing me now 70 errors

Error:(97, 54) illegal start of type
Error:(241, 50) illegal start of type
Error:(411, 29) expected
Error:(411, 31) '{' expected
Error:(411, 46) not a statement
Error:(411, 47) ';' expected
Error:(416, 5) illegal start of expression
Error:(416, 13) illegal start of expression
Error:(416, 42) ';' expected
Error:(416, 60) ';' expected
Error:(416, 69) not a statement
Error:(416, 82) ';' expected
Error:(416, 84) not a statement
Error:(416, 95) ';' expected
Error:(429, 5) illegal start of expression
Error:(429, 47) ';' expected
Error:(429, 57) not a statement
Error:(429, 68) ';' expected
Error:(441, 5) illegal start of expression
Error:(441, 13) illegal start of expression
Error:(441, 30) ';' expected
Error:(441, 63) ';' expected
Error:(441, 64) not a statement
Error:(441, 70) ';' expected
Error:(442, 19) ';' expected
Error:(442, 20) not a statement
Error:(442, 30) ';' expected
Error:(442, 39) not a statement
Error:(442, 52) ';' expected
Error:(452, 5) illegal start of expression
Error:(452, 13) illegal start of expression
Error:(452, 40) ';' expected
Error:(452, 73) ';' expected
Error:(452, 74) not a statement
Error:(452, 80) ';' expected
Error:(453, 19) ';' expected
Error:(453, 20) not a statement
Error:(453, 30) ';' expected
Error:(453, 39) not a statement
Error:(453, 52) ';' expected
Error:(481, 5) illegal start of expression
Error:(481, 13) illegal start of expression
Error:(481, 35) ';' expected
Error:(481, 68) ';' expected
Error:(481, 69) not a statement
Error:(481, 73) ';' expected
Error:(482, 19) ';' expected
Error:(482, 20) not a statement
Error:(482, 30) ';' expected
Error:(482, 39) not a statement
Error:(482, 52) ';' expected
Error:(489, 2) reached end of file while parsing

That illegal type showing this "<>"

Migration to Kotlin.

Are there any plans about migrating to kotlin? If there are, Would love to contribute migrating.

Actually this is not an issue,its a request pls help

How can i update questions from a json file using a server

Is it possible to update "categories.json" in "raw" folder
I am New to programming hope someone will help
Thank u
(I know this is not the right place to ask.if is is inappropriate pls remove it) :)

Installation on pre-lollipop

Hi,
The application can not be installed on Android 5 down
I have Android 4.4 and 4, but the program is not installed
Please solve this problem.

Category cards in CategorySelectionActivity disappeared after coming back from QuizActivity

On some conditions, all the visible category cards disappeared after coming back from QuizActivity. Like the screenshot below:

But you can still scroll up those left cards which are outside the screen previously.

Though not guaranteed, you may reproduce this bug as following:

  1. Click one category card to go to QuizActivity;
  2. Press back to go back to CategorySelectionActivity;
  3. Repeat 1 & 2 until the bug occurs.

Or, you can do the following steps to make it easier to happen:

  1. Go to Developer options in Settings;
  2. Change Animator duration scale to 5x or 10x;
  3. Back to Topeka;
  4. Click one category card to go to QuizActivity;
  5. Press back, and don't stop, press back a few more times duration the window transition;
  6. Repeat 4 & 5 until the bug occurs.

What's strange is that it can be reproduced 100% consecutively sometimes even I kill the App from the overview screen.

Phone: Nexus 6P
Android version: 7.0
Code: latest of master branch

Logout icon instead of action menu with only one item

Hi,

I would like to suggest you to instead of using exisiting action menu with logout item try to implement nice -looking button in this place. I think it might improve a little an user experience of this app.

What do you think guys about this idea?

Cheers

Import

Why can't I import the following dependencies?

compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.apis:google-api-services-youtube:v3-rev149-1.20.0'
compile 'com.google.http-client:google-http-client-android:1.20.0'
compile 'com.google.api-client:google-api-client-android:1.20.0'
compile 'com.google.api-client:google-api-client-gson:1.20.0'

I keep getting these errors:

C:\Android\Projects\android-topeka-master-master\android-topeka-master-master\app\src\main\java\com\google\samples\apps\topeka\com\george\videos\GetPlaylistTitlesAsyncTask.java
Error:(13, 76) error: cannot find symbol class PlaylistListResponse
Error:(18, 13) error: cannot find symbol class YouTube
Error:(20, 39) error: cannot find symbol class YouTube
Error:(25, 15) error: cannot find symbol class PlaylistListResponse

Crash on statup

Process: com.google.samples.apps.topeka, PID: 8042
java.lang.OutOfMemoryError: Failed to allocate a 5017612 byte allocation with 2098356 free bytes and 2MB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:609)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:988)
at android.content.res.Resources.loadDrawableForCookie(Resources.java:2474)
at android.content.res.Resources.loadDrawable(Resources.java:2381)
at android.content.res.Resources.getDrawable(Resources.java:787)
at android.content.Context.getDrawable(Context.java:403)
at android.widget.ImageView.resolveUri(ImageView.java:747)
at android.widget.ImageView.setImageResource(ImageView.java:398)
at com.google.samples.apps.topeka.adapter.AvatarAdapter.setAvatar(AvatarAdapter.java:52)
at com.google.samples.apps.topeka.adapter.AvatarAdapter.getView(AvatarAdapter.java:47)
at android.widget.AbsListView.obtainView(AbsListView.java:2347)
at android.widget.GridView.makeAndAddView(GridView.java:1433)
at android.widget.GridView.makeRow(GridView.java:361)
at android.widget.GridView.fillDown(GridView.java:302)
at android.widget.GridView.fillFromTop(GridView.java:437)
at android.widget.GridView.layoutChildren(GridView.java:1276)
at android.widget.AbsListView.onLayout(AbsListView.java:2151)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2114)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1843)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1061)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5885)
at android.view.Choreographer$CallbackRecord.run(
06-19 01:40:29.310 8042-8056/com.google.samples.apps.topeka I/art﹕ Clamp target GC heap from 102MB to 96MB

The app crashes due to missing Test annotation and latest avatar selection changes

This test was not annotated:

com.google.samples.apps.topeka.activity.SignInActivityTest > signIn_performSignIn[Nexus 5 - 6.0] FAILED
        android.support.test.espresso.PerformException: Error performing 'single click' on view 'with id: com.google.samples.apps.topeka:id/done'.
        at android.support.test.espresso.PerformException$Builder.build(PerformException.java:83)

We can add a default avatar but then a new test would fail:

com.google.samples.apps.topeka.activity.SignInActivityTest > avatar_noneChecked[Nexus 5 - 6.0] FAILED
        android.support.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'not with checkbox state: is <true>' doesn't match the selected view.
        Expected: not with checkbox state: is <true>

These latest changes and the next method seem to consider all the preferences required:

    /**
     * Check whether a user is currently signed in.
     *
     * @param context The context to check this in.
     * @return <code>true</code> if login data exists, else <code>false</code>.
     */
    public static boolean isSignedIn(Context context) {
        final SharedPreferences preferences = getSharedPreferences(context);
        return preferences.contains(PREFERENCE_FIRST_NAME) &&
                preferences.contains(PREFERENCE_LAST_INITIAL) &&
                preferences.contains(PREFERENCE_AVATAR);
    }

So getPlayer needs to be stricter and change && by || like this:

        if (null == firstName || null == lastInitial || null == avatar) {

Otherwise I think would be possible to be signed in and be considered signed out in some places.

The textWatcher currently only detects that one editText contains text.

It's necessary to only show the mFabDone when an avatar is selected and both editText contain text.

I added tests that detect these issues and offer a possible solution to fix it:

com.google.samples.apps.topeka.activity.SignInActivityTest > signIn_withoutFirstNameFailed[Nexus 5 - 6.0] FAILED
        android.support.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'not is displayed on the screen to the user' doesn't match the selected view.
        Expected: not is displayed on the screen to the user

com.google.samples.apps.topeka.activity.SignInActivityTest > signIn_withoutLastInitialFailed[Nexus 5 - 6.0] FAILED
        android.support.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'not is displayed on the screen to the user' doesn't match the selected view.
        Expected: not is displayed on the screen to the user

com.google.samples.apps.topeka.activity.SignInActivityTest > signIn_withoutAvatarFailed[Nexus 5 - 6.0] FAILED
        android.support.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'not is displayed on the screen to the user' doesn't match the selected view.
        Expected: not is displayed on the screen to the user

11-18 13:46:51.797 25212-25212/com.google.samples.apps.topeka 
E/AndroidRuntime: FATAL EXCEPTION: main
 Process: com.google.samples.apps.topeka, PID: 25212
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Enum.name()' on a null object reference
    at com.google.samples.apps.topeka.helper.PreferencesHelper.writeToPreferences(PreferencesHelper.java:49)
    at com.google.samples.apps.topeka.fragment.SignInFragment.savePlayer(SignInFragment.java:238)
    at com.google.samples.apps.topeka.fragment.SignInFragment.access$200(SignInFragment.java:48)
    at com.google.samples.apps.topeka.fragment.SignInFragment$3.onClick(SignInFragment.java:161)
    at android.view.View.performClick(View.java:5198)
    at android.view.View$PerformClick.run(View.java:21147)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5417)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Crash in answer verification in AlphaPickerQuizView

Process: com.google.samples.apps.topeka, PID: 9969
java.lang.ClassCastException: android.text.SpannableString cannot be cast to java.lang.String
        at com.google.samples.apps.topeka.widget.quiz.AlphaPickerQuizView.isAnswerCorrect(AlphaPickerQuizView.java:62)
        at com.google.samples.apps.topeka.widget.quiz.AbsQuizView.submitAnswer(AbsQuizView.java:290)
        at com.google.samples.apps.topeka.widget.quiz.AbsQuizView.onClick(AbsQuizView.java:274)
        at android.view.View.performClick(View.java:4832)
        at android.view.View$PerformClick.run(View.java:19839)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:211)
        at android.app.ActivityThread.main(ActivityThread.java:5321)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1016)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)

Answer key and Image

Hi,
here is a sample question

{
    "type": "single-select-item",
    "question": "What U.S. President committed an unpardonable sin by kissing the Queen Mother on the lips?",
    "options": [
      "George W. Bush",
      "Jimmy Carter",
      "Barack Obama",
      "Lyndon B. Johnson",
      "Ronald Reagan"
    ],
    "answer": [1]
  },

What the meaning of answer": [1] ?
is 1 stand for George W. Bush?
or
The answer only 1 ?
i tried answer George W. Bush but wrong...

And,
How to change image logo (Music,Sport,Entertaiment etc)
Should i change the png or the xml?
Thank you very much ^_^

Unable to build project

I am unable to do a gradle build on the latest code. The app's build.gradle fails. See screenshot:
screen shot 2016-02-23 at 9 40 15 am

Duplicate class errors when "Enable all test artifacts" enabled.

In Android Studio 2.0, in experimental Gradle settings, there is an option to enable all test artifacts at the same time. This removes the necessity to change to "Unit Tests" and "Instrumentation Tests" in Build Variants section every time.

When this is enabled, the source sets in both test and androidTest folders are included. And this causes conflicts in class names. Here is the screenshot.

image

IndexOutOfBoundsException at AlphaPickerQuizView.java:83

In the question "Which letter other than X scores 8 in Scrabble?" it crashes when moving the SeekBar to the end past Z.

06-16 19:27:08.304 15982-15982/com.google.samples.apps.topeka E/InputEventReceiver﹕ Exception dispatching input event.
06-16 19:27:08.305 15982-15982/com.google.samples.apps.topeka D/AndroidRuntime﹕ Shutting down VM
06-16 19:27:08.327 15982-15982/com.google.samples.apps.topeka E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.google.samples.apps.topeka, PID: 15982
java.lang.IndexOutOfBoundsException: Invalid index 26, size is 26
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
at java.util.Arrays$ArrayList.get(Arrays.java:66)
at com.google.samples.apps.topeka.widget.quiz.AlphaPickerQuizView.onProgressChanged(AlphaPickerQuizView.java:83)
at android.widget.SeekBar.onProgressRefresh(SeekBar.java:95)
at android.widget.ProgressBar.doRefreshProgress(ProgressBar.java:1262)
at android.widget.ProgressBar.refreshProgress(ProgressBar.java:1274)
at android.widget.ProgressBar.setProgress(ProgressBar.java:1321)
at android.widget.AbsSeekBar.trackTouchEvent(AbsSeekBar.java:661)
at android.widget.AbsSeekBar.onTouchEvent(AbsSeekBar.java:581)
at android.view.View.dispatchTouchEvent(View.java:8471)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2369)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1719)
at android.app.Activity.dispatchTouchEvent(Activity.java:2742)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2330)
at android.view.View.dispatchPointerEvent(View.java:8666)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4123)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3989)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3544)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3597)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3563)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3680)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3571)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3737)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3544)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3597)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3563)
at android.view.ViewRootImpl$InputStage.apply(Vi

Integrate Topeka app with Continuous Integration tool - Travis CI

Hi@keyboardsurfer,

I saw that you experimented this day with Drone.io CI tool. Why did you deleted this branch? If drone.io was not enough good for you, too much complicated, lack in features or ..., please check Travis. I find this CI tool very useful.

Cheers.

Crash if rotate device right after press floating action button

Device: Nexus 4
Android version: 5.1.1

06-17 10:09:14.906 29419-29419/com.google.samples.apps.topeka E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.google.samples.apps.topeka, PID: 29419
java.lang.IllegalStateException: Fragment QuizFragment{25fbd5d1} not attached to Activity
at android.app.Fragment.getResources(Fragment.java:788)
at android.app.Fragment.getString(Fragment.java:823)
at com.google.samples.apps.topeka.fragment.QuizFragment.setProgress(QuizFragment.java:119)
at com.google.samples.apps.topeka.fragment.QuizFragment.showNextPage(QuizFragment.java:200)
at com.google.samples.apps.topeka.activity.QuizActivity.submitAnswer(QuizActivity.java:217)
at com.google.samples.apps.topeka.activity.QuizActivity.proceed(QuizActivity.java:212)
at com.google.samples.apps.topeka.widget.quiz.AbsQuizView$3.run(AbsQuizView.java:345)
at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1121)
at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1171)
at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:722)
at android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:738)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.Choreographer.doFrame(Choreographer.java:549)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

UPD. the same issue if press back button right after press press floating action button

Update Json changes to already Installed Application

hi,
If I make any change to

categories.json

like adding new categories or quizz in my android application. and If I have already installed that on my phone. when I reinstall / update that application on mobile it doesn't update the categories.json changes. (i must unninstal Previous version and install new version To apply the changes)
This problem can be solved in a sqlite database with the following code,but in json i dont know how to fix it.tnx

private static final int DATABASE_VERSION = 1;
public DatabaseHandler(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}

DataBindingUtil ActivityCategorySelectionBinding not found

That's my issues:
Error:(23, 27) error: package android.databinding not found
Error:(40, 50) error: package com.google.samples.apps.topeka.databinding not found
Error:(71, 9) error: not found
符号: class ActivityCategorySelectionBinding
位置: class CategorySelectionActivity
Error:(71, 52) error: not found
符号: 变量 DataBindingUtil
位置: class CategorySelectionActivity

Model classes implement Parcelable

All model classes implement Parcelable interface.
In fact "parcelability" of those classes not used anywhere in production code.
It's used only in tests that are testing if those Parcelable classes are being parcelarized correctly.
Why?

How to change quiz?

Hi,
im sorry this is really bad question.
but how to change the questing and answer?

Thanks

FATAL EXCEPTION: main

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.google.samples.apps.topeka, PID: 26114
java.lang.NullPointerException: Attempt to invoke a virtual method on a null object reference
at com.google.samples.apps.topeka.helper.PreferencesHelper.writeToPreferences(PreferencesHelper.java:49)
at com.google.samples.apps.topeka.fragment.SignInFragment.savePlayer(SignInFragment.java:238)
at com.google.samples.apps.topeka.fragment.SignInFragment.access$200(SignInFragment.java:48)
at com.google.samples.apps.topeka.fragment.SignInFragment$3.onClick(SignInFragment.java:161)
at android.view.View.performClick(View.java:4820)
at android.view.View$PerformClick.run(View.java:20157)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5576)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:955)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:750)

crash while trying to load the avatar selection screen

I wrote a name and last initial, and then clicked the 'choose an avatar' button, and the app crashed:

FATAL EXCEPTION: main
Process: com.google.samples.apps.topeka, PID: 24314
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.samples.apps.topeka/com.google.samples.apps.topeka.activity.CategorySelectionActivity}: android.content.res.Resources$NotFoundException: File res/drawable/avatar_1.xml from drawable resource ID #0x7f020000
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2345)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2407)
    at android.app.ActivityThread.access$800(ActivityThread.java:149)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1324)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:211)
    at android.app.ActivityThread.main(ActivityThread.java:5321)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1016)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/avatar_1.xml from drawable resource ID #0x7f020000
    at android.content.res.Resources.loadDrawableForCookie(Resources.java:2648)
    at android.content.res.Resources.loadDrawable(Resources.java:2525)
    at android.content.res.Resources.getDrawable(Resources.java:799)
    at android.content.Context.getDrawable(Context.java:402)
    at com.google.samples.apps.topeka.activity.CategorySelectionActivity.setUpToolbar(CategorySelectionActivity.java:81)
    at com.google.samples.apps.topeka.activity.CategorySelectionActivity.onCreate(CategorySelectionActivity.java:59)
    at android.app.Activity.performCreate(Activity.java:5933)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
    ... 10 more
Caused by: java.lang.NumberFormatException: Invalid float: ".2.1"
    at java.lang.StringToReal.invalidReal(StringToReal.java:63)
    at java.lang.StringToReal.initialParse(StringToReal.java:160)
    at java.lang.StringToReal.parseFloat(StringToReal.java:323)
    at java.lang.Float.parseFloat(Float.java:306)
    at android.util.PathParser.getFloats(PathParser.java:178)
    at android.util.PathParser.createNodesFromPathData(PathParser.java:59)
    at android.graphics.drawable.VectorDrawable$VFullPath.updateStateFromTypedArray(VectorDrawable.java:1439)
    at android.graphics.drawable.VectorDrawable$VFullPath.inflate(VectorDrawable.java:1421)
    at android.graphics.drawable.VectorDrawable.inflateInternal(VectorDrawable.java:542)
    at android.graphics.drawable.VectorDrawable.inflate(VectorDrawable.java:458)
    at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1126)
    at android.graphics.drawable.Drawable.createFromXml(Drawable.java:1033)
    at android.content.res.Resources.loadDrawableForCookie(Resources.java:2638)
    ... 18 more

I'm using a Sony Xperia Z3 Compact, with Android 5.0. Let me know if I can provide any more information.

AnimationAwareTestRule not working

transitionAnimationScale, windowAnimationScale, animatorDuration scale are always 0, regardless of what the actual settings are.

Tested on real device on M (5x), emulator on L + M

p.s. huge fan of your twitter table flipping

edit 2: found the source of the problem: if the animation settings have never been touched, Settings.Global.getFloat(resolver, setting) will trigger SettingNotFoundException. The rule works fine after any of the animation settings are changed at least once. Any solution to this?

1/com.google.samples.apps.topeka E/AndroidRuntime: FATAL EXCEPTION: main android.view.InflateException: Binary XML file line #17: Error inflating class com.google.samples.apps.topeka.widget.AvatarView

1/com.google.samples.apps.topeka E/AndroidRuntime: FATAL EXCEPTION: main
android.view.InflateException: Binary XML file line #17: Error inflating class com.google.samples.apps.topeka.widget.AvatarView
    at android.view.LayoutInflater.createView(LayoutInflater.java:613)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
    at com.google.samples.apps.topeka.adapter.AvatarAdapter.getView(AvatarAdapter.java:45)
    at android.widget.AbsListView.obtainView(AbsListView.java:2159)
    at android.widget.GridView.onMeasure(GridView.java:1040)
    at android.view.View.measure(View.java:15518)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404)
    at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
    at android.view.View.measure(View.java:15518)
    at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1231)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:590)
    at android.view.View.measure(View.java:15518)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
    at android.view.View.measure(View.java:15518)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
    at android.view.View.measure(View.java:15518)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
    at android.view.View.measure(View.java:15518)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
    at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:135)
    at android.view.View.measure(View.java:15518)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404)
    at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
    at android.view.View.measure(View.java:15518)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
    at android.view.View.measure(View.java:15518)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404)
    at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
    at android.view.View.measure(View.java:15518)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
    at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2185)
    at android.view.View.measure(View.java:15518)
    at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1877)
    at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1092)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1268)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:992)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4376)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:791)
    at android.view.Choreographer.doCallbacks(Choreographer.java:591)
    at android.view.Choreographer.doFrame(Choreographer.java:561)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:777)
    at android.os.Handler.handleCallback(Handler.java:725)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:152)
    at android.app.ActivityThread.main(ActivityThread.java:5132)
    at java.lang.reflect.Method.invokeNative(Native Met

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.