├── .gitignore
├── AndroidManifest.xml
├── Development Concepts - Material Design CoP.docx
├── Development Concepts - Material Design CoP.pdf
├── LICENSE
├── MaterialDesignSupport.apk
├── Principles - Material Design CoP.docx
├── Principles - Material Design CoP.pdf
├── README.md
├── art
├── Material Design - Screen Shot 1.png
├── Material Design - Screen Shot 2.png
├── Material Design - Screen Shot 3.png
├── Material Design - Screen Shot 4.png
├── Material Design - Screen Shot 5.png
└── Material Design - Screen Shot 6.png
├── libs
├── android-support-v4.jar
└── cardview.jar
├── proguard-project.txt
├── project.properties
├── res
├── drawable-hdpi
│ └── ic_action_back_white.png
├── drawable-mdpi
│ └── ic_action_back_white.png
├── drawable-xhdpi
│ ├── chevron.png
│ ├── close_button_white.png
│ ├── curly_white.png
│ ├── drawer_shadow.9.png
│ ├── ic_action_back.png
│ ├── ic_action_back_white.png
│ ├── ic_action_collapse.png
│ ├── ic_action_collapse_small.png
│ ├── ic_action_expand.png
│ ├── ic_action_expand_small.png
│ ├── ic_action_forward.png
│ ├── ic_action_forward_white.png
│ ├── ic_action_play.png
│ ├── northstar_white.png
│ └── slide_white.png
├── drawable-xxhdpi
│ ├── activity_transition_enable_transition.png
│ ├── activity_transition_enter_example.png
│ ├── activity_transition_exit_example.png
│ ├── activity_transition_shared_element_callee.png
│ ├── activity_transition_shared_element_caller.png
│ ├── activity_transition_shared_element_kick_off.png
│ ├── app_environment_depth_hierarchy.png
│ ├── app_environment_device_space.png
│ ├── card_view_layout_xml.png
│ ├── card_view_resulting_ui_element.png
│ ├── elevation_code_sample.png
│ ├── elevation_dimens_specifications.png
│ ├── elevation_image_button.png
│ ├── elevation_translation_z.png
│ ├── ic_action_back.png
│ ├── ic_action_back_white.png
│ ├── ic_action_collapse.png
│ ├── ic_action_expand.png
│ ├── ic_action_forward.png
│ ├── ic_action_forward_white.png
│ ├── ic_action_play.png
│ ├── ic_drawer.png
│ ├── ic_launcher.png
│ ├── one_adaptive_design_01_adaptive.png
│ ├── one_adaptive_design_02_adaptive.png
│ ├── one_adaptive_design_responsive.png
│ ├── paper_and_ink_fab_seam.png
│ ├── paper_and_ink_fab_step.png
│ ├── paper_and_ink_ink.png
│ ├── paper_and_ink_seam.png
│ ├── paper_and_ink_step.png
│ ├── paper_and_ink_toolbar.png
│ ├── ripple_button_borders.png
│ ├── ripple_default_color_image.png
│ ├── ripple_fab_declaration.png
│ ├── ripple_fab_imagebutton.png
│ ├── ripple_fab_shape.png
│ ├── ripple_water.png
│ ├── view_animation_animate_view_down.png
│ ├── view_animation_animate_view_up.png
│ ├── view_animation_path_interpolator_code.png
│ ├── view_animation_path_interpolator_inclusion_code.png
│ ├── view_animation_path_interpolator_inclusion_xml.png
│ ├── view_animation_path_interpolator_xml.png
│ ├── view_clipping.png
│ ├── view_clipping_interstital.png
│ ├── view_clipping_java.png
│ ├── view_clipping_layout.png
│ ├── view_clipping_shape_layout.png
│ ├── visual_design_01_grid.png
│ ├── visual_design_02_grid.png
│ ├── visual_design_color.png
│ ├── visual_design_illustration.png
│ ├── visual_design_photography.png
│ ├── visual_design_system_icons.png
│ ├── visual_design_type_rhythm.png
│ ├── visual_design_typographic_scale.png
│ ├── what_is_material_boucicaut_meister.png
│ ├── what_is_material_card.png
│ └── what_is_material_magic_the_gathering.png
├── drawable-xxxhdpi
│ └── ic_launcher.png
├── drawable
│ ├── expandable_list_view_selector.xml
│ ├── fab_button_states.xml
│ ├── interstitial_fab.xml
│ ├── interstitial_fab_ripple.xml
│ ├── playground_fab.xml
│ ├── presentation_fab.xml
│ └── presentation_fab_ripple.xml
├── layout
│ ├── core_material.xml
│ ├── core_material_drawer.xml
│ ├── drawer_child_navigation_row.xml
│ ├── drawer_divider_row.xml
│ ├── drawer_expandable_row.xml
│ ├── drawer_navigation_row.xml
│ ├── interstitial_layout.xml
│ ├── playground_action_bar_card_row.xml
│ ├── playground_action_card_row.xml
│ ├── playground_detail_layout.xml
│ ├── playground_elevation_card_row.xml
│ ├── playground_layout.xml
│ ├── playground_navigation_card_row.xml
│ ├── presentation_action_bar_row.xml
│ ├── presentation_image_row.xml
│ ├── presentation_information_row.xml
│ ├── presentation_layout.xml
│ ├── presentation_navigation_row.xml
│ ├── presentation_title_row.xml
│ └── presentation_video_row.xml
├── raw
│ ├── activity_transition.mp4
│ ├── elevation_example.mp4
│ ├── meaningful_motion_animation_responsive.mp4
│ ├── meaningful_motion_shared_stage.mp4
│ ├── meaningful_motion_transition_directs_focus.mp4
│ ├── paper_and_ink_ink_fill.mp4
│ ├── ripple_default_color_video_four.mp4
│ ├── ripple_default_color_video_one.mp4
│ ├── ripple_default_color_video_three.mp4
│ ├── ripple_default_color_video_two.mp4
│ ├── ripple_fab_interaction.mp4
│ ├── vew_animation_path_interpolator_vs_linear.mp4
│ ├── view_animation_accelerate_decelerate_interpolator.mp4
│ ├── view_animation_path_interpolator.mp4
│ ├── view_animation_reveal_effect.mp4
│ ├── visual_design_dynamic_color.mp4
│ ├── what_is_material_input_ripple.mp4
│ └── what_is_material_paper_transforming.mp4
└── values
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
└── src
└── com
└── wildsmith
└── material
├── core
├── CoreMaterialActivity.java
├── CoreMaterialApplication.java
├── CoreMaterialFragment.java
└── CoreMaterialListFragment.java
├── drawer
├── DrawerListRowAdapter.java
├── DrawerListRowFactory.java
├── DrawerOnClickListener.java
├── DrawerToggleListener.java
└── rows
│ ├── ChildNavigationDrawerRow.java
│ ├── DividerDrawerRow.java
│ ├── ExpandableDrawerRow.java
│ └── NavigationDrawerRow.java
├── interstitial
├── InterstitialActivity.java
└── InterstitialFragment.java
├── list
├── ListRow.java
├── ListRowAdapter.java
└── expandable
│ ├── AnimatedExpandableListAdapter.java
│ ├── AnimatedExpandableListView.java
│ ├── ExpandCollapseAnimation.java
│ ├── ExpandableListDummyView.java
│ ├── ExpandableListRow.java
│ └── ExpandableListStateHolder.java
├── playground
├── PlaygroundActivity.java
├── PlaygroundFragment.java
├── PlaygroundListRowAdapter.java
├── detail
│ ├── PlaygroundDetailActivity.java
│ └── PlaygroundDetailFragment.java
└── rows
│ ├── PlaygroundActionBarCardRow.java
│ ├── PlaygroundActionCardRow.java
│ ├── PlaygroundCardListRow.java
│ ├── PlaygroundElevationCardRow.java
│ └── PlaygroundNavigationCardRow.java
├── presentation
├── PresentationActivity.java
├── PresentationListFragment.java
├── PresentationListRowAdapter.java
├── PresentationSlideFactory.java
├── devtopics
│ ├── ActivityTransitionActivity.java
│ ├── ActivityTransitionFragment.java
│ ├── CardViewActivity.java
│ ├── CardViewFragment.java
│ ├── ElevationActivity.java
│ ├── ElevationFragment.java
│ ├── RippleActivity.java
│ ├── RippleFragment.java
│ ├── ViewAnimationActivity.java
│ ├── ViewAnimationFragment.java
│ ├── ViewClippingActivity.java
│ └── ViewClippingFragment.java
├── rows
│ ├── PresentationActionBarRow.java
│ ├── PresentationImageRow.java
│ ├── PresentationInformationRow.java
│ ├── PresentationListRow.java
│ ├── PresentationNavigationRow.java
│ ├── PresentationTitleRow.java
│ └── PresentationVideoRow.java
└── uitopics
│ ├── AppEnvironmentActivity.java
│ ├── AppEnvironmentFragment.java
│ ├── MeaningfulMotionActivity.java
│ ├── MeaningfulMotionFragment.java
│ ├── OneAdaptiveDesignActivity.java
│ ├── OneAdaptiveDesignFragment.java
│ ├── PaperAndInkActivity.java
│ ├── PaperAndInkFragment.java
│ ├── VisualDesignActivity.java
│ ├── VisualDesignFragment.java
│ ├── WhatIsMaterialActivity.java
│ └── WhatIsMaterialFragment.java
├── utils
├── ResourceHelper.java
└── StringUtils.java
└── views
├── EditTextLabelFloat.java
├── FloatingActionButton.java
├── VideoViewRecycler.java
└── ViewHelper.java
/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.ap_
4 |
5 | # Files for the Dalvik VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # Generated files
12 | bin/
13 | gen/
14 |
15 | # Gradle files
16 | .gradle/
17 | build/
18 |
19 | # Local configuration file (sdk path, etc)
20 | local.properties
21 |
22 | # Proguard folder generated by Eclipse
23 | proguard/
24 |
25 | *.pydevproject
26 | .project
27 | .metadata
28 | bin/**
29 | tmp/**
30 | tmp/**/*
31 | *.tmp
32 | *.bak
33 | *.swp
34 | *~.nib
35 | local.properties
36 | .classpath
37 | .settings/
38 | .loadpath
39 |
40 | # External tool builders
41 | .externalToolBuilders/
42 |
43 | # Locally stored "Eclipse launch configurations"
44 | *.launch
45 |
46 | # CDT-specific
47 | .cproject
48 |
49 | # PDT-specific
50 | .buildpath
51 |
--------------------------------------------------------------------------------
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
9 |
10 |
16 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
30 |
34 |
38 |
42 |
46 |
50 |
54 |
58 |
62 |
66 |
70 |
74 |
78 |
81 |
82 |
83 |
84 |
--------------------------------------------------------------------------------
/Development Concepts - Material Design CoP.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/Development Concepts - Material Design CoP.docx
--------------------------------------------------------------------------------
/Development Concepts - Material Design CoP.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/Development Concepts - Material Design CoP.pdf
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | The MIT License (MIT)
3 |
4 | Copyright (c) 2014 Thomas Belk
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | SOFTWARE.
23 |
--------------------------------------------------------------------------------
/MaterialDesignSupport.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/MaterialDesignSupport.apk
--------------------------------------------------------------------------------
/Principles - Material Design CoP.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/Principles - Material Design CoP.docx
--------------------------------------------------------------------------------
/Principles - Material Design CoP.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/Principles - Material Design CoP.pdf
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | MaterialDesignSupport
2 | =====================
3 |
4 | Duplicate project to MaterialDesign, BUT meant for non Android L devices.
5 |
6 | =====================
7 |
8 | Android project that focuses on the new design and development opportunities and concepts with Material Design. It can be broken down into three sections.
9 |
10 | 1. Presentation slides on Material Design philosophy. (Slides attached: Principles - Material Design CoP)
11 | 2. Presentation slides on Material Design development. (Slides attached: Development Concepts - Material Design CoP)
12 | 3. Playground for implemented use of new Android L APIs.
13 |
14 | Screen Shots
15 | ==============
16 |
17 | 
18 |
19 | 
20 |
21 | 
22 |
23 | 
24 |
25 | 
26 |
27 | 
28 |
--------------------------------------------------------------------------------
/art/Material Design - Screen Shot 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/art/Material Design - Screen Shot 1.png
--------------------------------------------------------------------------------
/art/Material Design - Screen Shot 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/art/Material Design - Screen Shot 2.png
--------------------------------------------------------------------------------
/art/Material Design - Screen Shot 3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/art/Material Design - Screen Shot 3.png
--------------------------------------------------------------------------------
/art/Material Design - Screen Shot 4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/art/Material Design - Screen Shot 4.png
--------------------------------------------------------------------------------
/art/Material Design - Screen Shot 5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/art/Material Design - Screen Shot 5.png
--------------------------------------------------------------------------------
/art/Material Design - Screen Shot 6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/art/Material Design - Screen Shot 6.png
--------------------------------------------------------------------------------
/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/libs/cardview.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/libs/cardview.jar
--------------------------------------------------------------------------------
/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-20
15 | android.library.reference.1=../../../Documents/Development/android-sdk-macosx/extras/android/m2repository/com/android/support/cardview-v7/21.0.0-rc1/cardview-v7-21.0.0-rc1
16 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_action_back_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-hdpi/ic_action_back_white.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_action_back_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-mdpi/ic_action_back_white.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/chevron.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xhdpi/chevron.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/close_button_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xhdpi/close_button_white.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/curly_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xhdpi/curly_white.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/drawer_shadow.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xhdpi/drawer_shadow.9.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xhdpi/ic_action_back.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_back_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xhdpi/ic_action_back_white.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_collapse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xhdpi/ic_action_collapse.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_collapse_small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xhdpi/ic_action_collapse_small.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_expand.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xhdpi/ic_action_expand.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_expand_small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xhdpi/ic_action_expand_small.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_forward.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xhdpi/ic_action_forward.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_forward_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xhdpi/ic_action_forward_white.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xhdpi/ic_action_play.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/northstar_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xhdpi/northstar_white.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/slide_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xhdpi/slide_white.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/activity_transition_enable_transition.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/activity_transition_enable_transition.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/activity_transition_enter_example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/activity_transition_enter_example.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/activity_transition_exit_example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/activity_transition_exit_example.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/activity_transition_shared_element_callee.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/activity_transition_shared_element_callee.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/activity_transition_shared_element_caller.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/activity_transition_shared_element_caller.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/activity_transition_shared_element_kick_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/activity_transition_shared_element_kick_off.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/app_environment_depth_hierarchy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/app_environment_depth_hierarchy.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/app_environment_device_space.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/app_environment_device_space.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/card_view_layout_xml.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/card_view_layout_xml.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/card_view_resulting_ui_element.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/card_view_resulting_ui_element.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/elevation_code_sample.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/elevation_code_sample.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/elevation_dimens_specifications.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/elevation_dimens_specifications.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/elevation_image_button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/elevation_image_button.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/elevation_translation_z.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/elevation_translation_z.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_action_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/ic_action_back.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_action_back_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/ic_action_back_white.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_action_collapse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/ic_action_collapse.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_action_expand.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/ic_action_expand.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_action_forward.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/ic_action_forward.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_action_forward_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/ic_action_forward_white.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_action_play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/ic_action_play.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_drawer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/ic_drawer.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/one_adaptive_design_01_adaptive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/one_adaptive_design_01_adaptive.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/one_adaptive_design_02_adaptive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/one_adaptive_design_02_adaptive.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/one_adaptive_design_responsive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/one_adaptive_design_responsive.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/paper_and_ink_fab_seam.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/paper_and_ink_fab_seam.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/paper_and_ink_fab_step.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/paper_and_ink_fab_step.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/paper_and_ink_ink.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/paper_and_ink_ink.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/paper_and_ink_seam.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/paper_and_ink_seam.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/paper_and_ink_step.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/paper_and_ink_step.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/paper_and_ink_toolbar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/paper_and_ink_toolbar.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ripple_button_borders.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/ripple_button_borders.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ripple_default_color_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/ripple_default_color_image.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ripple_fab_declaration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/ripple_fab_declaration.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ripple_fab_imagebutton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/ripple_fab_imagebutton.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ripple_fab_shape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/ripple_fab_shape.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ripple_water.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/ripple_water.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/view_animation_animate_view_down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/view_animation_animate_view_down.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/view_animation_animate_view_up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/view_animation_animate_view_up.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/view_animation_path_interpolator_code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/view_animation_path_interpolator_code.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/view_animation_path_interpolator_inclusion_code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/view_animation_path_interpolator_inclusion_code.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/view_animation_path_interpolator_inclusion_xml.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/view_animation_path_interpolator_inclusion_xml.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/view_animation_path_interpolator_xml.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/view_animation_path_interpolator_xml.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/view_clipping.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/view_clipping.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/view_clipping_interstital.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/view_clipping_interstital.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/view_clipping_java.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/view_clipping_java.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/view_clipping_layout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/view_clipping_layout.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/view_clipping_shape_layout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/view_clipping_shape_layout.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/visual_design_01_grid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/visual_design_01_grid.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/visual_design_02_grid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/visual_design_02_grid.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/visual_design_color.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/visual_design_color.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/visual_design_illustration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/visual_design_illustration.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/visual_design_photography.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/visual_design_photography.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/visual_design_system_icons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/visual_design_system_icons.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/visual_design_type_rhythm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/visual_design_type_rhythm.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/visual_design_typographic_scale.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/visual_design_typographic_scale.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/what_is_material_boucicaut_meister.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/what_is_material_boucicaut_meister.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/what_is_material_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/what_is_material_card.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/what_is_material_magic_the_gathering.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxhdpi/what_is_material_magic_the_gathering.png
--------------------------------------------------------------------------------
/res/drawable-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/drawable-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable/expandable_list_view_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/drawable/fab_button_states.xml:
--------------------------------------------------------------------------------
1 |
2 | -
5 |
11 |
12 | -
13 |
19 |
20 |
--------------------------------------------------------------------------------
/res/drawable/interstitial_fab.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/drawable/interstitial_fab_ripple.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/drawable/playground_fab.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/drawable/presentation_fab.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/drawable/presentation_fab_ripple.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/layout/core_material.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
18 |
19 |
--------------------------------------------------------------------------------
/res/layout/core_material_drawer.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
12 |
13 |
18 |
19 |
29 |
30 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/res/layout/drawer_child_navigation_row.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
13 |
14 |
22 |
23 |
--------------------------------------------------------------------------------
/res/layout/drawer_divider_row.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/res/layout/drawer_expandable_row.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
13 |
14 |
22 |
23 |
31 |
32 |
--------------------------------------------------------------------------------
/res/layout/drawer_navigation_row.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
13 |
14 |
24 |
25 |
--------------------------------------------------------------------------------
/res/layout/interstitial_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
21 |
22 |
30 |
31 |
32 |
33 |
41 |
42 |
51 |
52 |
53 |
61 |
62 |
63 |
64 |
69 |
70 |
75 |
76 |
86 |
87 |
--------------------------------------------------------------------------------
/res/layout/playground_action_bar_card_row.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/layout/playground_action_card_row.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
15 |
16 |
17 |
20 |
21 |
30 |
31 |
43 |
44 |
45 |
52 |
53 |
58 |
59 |
65 |
66 |
67 |
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/res/layout/playground_detail_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
24 |
25 |
28 |
29 |
38 |
39 |
40 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/res/layout/playground_elevation_card_row.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
15 |
16 |
17 |
20 |
21 |
30 |
31 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/res/layout/playground_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
14 |
22 |
23 |
24 |
30 |
31 |
41 |
42 |
--------------------------------------------------------------------------------
/res/layout/playground_navigation_card_row.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
15 |
16 |
17 |
20 |
21 |
30 |
31 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/res/layout/presentation_action_bar_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/res/layout/presentation_image_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
24 |
25 |
30 |
31 |
32 |
37 |
38 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/res/layout/presentation_information_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
26 |
27 |
40 |
41 |
46 |
47 |
48 |
53 |
54 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/res/layout/presentation_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
16 |
27 |
28 |
37 |
38 |
--------------------------------------------------------------------------------
/res/layout/presentation_navigation_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
24 |
25 |
33 |
34 |
35 |
41 |
42 |
51 |
52 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/res/layout/presentation_title_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
24 |
25 |
30 |
31 |
32 |
37 |
38 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/res/layout/presentation_video_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
19 |
20 |
26 |
27 |
31 |
32 |
38 |
39 |
40 |
45 |
46 |
47 |
52 |
53 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/res/raw/activity_transition.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/raw/activity_transition.mp4
--------------------------------------------------------------------------------
/res/raw/elevation_example.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/raw/elevation_example.mp4
--------------------------------------------------------------------------------
/res/raw/meaningful_motion_animation_responsive.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/raw/meaningful_motion_animation_responsive.mp4
--------------------------------------------------------------------------------
/res/raw/meaningful_motion_shared_stage.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/raw/meaningful_motion_shared_stage.mp4
--------------------------------------------------------------------------------
/res/raw/meaningful_motion_transition_directs_focus.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/raw/meaningful_motion_transition_directs_focus.mp4
--------------------------------------------------------------------------------
/res/raw/paper_and_ink_ink_fill.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/raw/paper_and_ink_ink_fill.mp4
--------------------------------------------------------------------------------
/res/raw/ripple_default_color_video_four.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/raw/ripple_default_color_video_four.mp4
--------------------------------------------------------------------------------
/res/raw/ripple_default_color_video_one.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/raw/ripple_default_color_video_one.mp4
--------------------------------------------------------------------------------
/res/raw/ripple_default_color_video_three.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/raw/ripple_default_color_video_three.mp4
--------------------------------------------------------------------------------
/res/raw/ripple_default_color_video_two.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/raw/ripple_default_color_video_two.mp4
--------------------------------------------------------------------------------
/res/raw/ripple_fab_interaction.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/raw/ripple_fab_interaction.mp4
--------------------------------------------------------------------------------
/res/raw/vew_animation_path_interpolator_vs_linear.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/raw/vew_animation_path_interpolator_vs_linear.mp4
--------------------------------------------------------------------------------
/res/raw/view_animation_accelerate_decelerate_interpolator.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/raw/view_animation_accelerate_decelerate_interpolator.mp4
--------------------------------------------------------------------------------
/res/raw/view_animation_path_interpolator.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/raw/view_animation_path_interpolator.mp4
--------------------------------------------------------------------------------
/res/raw/view_animation_reveal_effect.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/raw/view_animation_reveal_effect.mp4
--------------------------------------------------------------------------------
/res/raw/visual_design_dynamic_color.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/raw/visual_design_dynamic_color.mp4
--------------------------------------------------------------------------------
/res/raw/what_is_material_input_ripple.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/raw/what_is_material_input_ripple.mp4
--------------------------------------------------------------------------------
/res/raw/what_is_material_paper_transforming.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shawwinbin/MaterialDesignSupport/8b276466dc9104d3dca38b7585739ddd3f6dc44d/res/raw/what_is_material_paper_transforming.mp4
--------------------------------------------------------------------------------
/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #FF6639B6
5 | #FF4E2C8B
6 | @color/light_purple
7 | @color/dark_purple
8 | #D0D0D0
9 | #FFFFFF
10 | @color/light_purple
11 | #DE000000
12 | @android:color/darker_gray
13 | #8A000000
14 | #FF00BEA4
15 | #FFF6F6F6
16 | #FF1CE8B5
17 | #42000000
18 | #8A000000
19 | #FF00BEA4
20 | #FF25A599
21 | #DE000000
22 | #FF1CE8B5
23 | #8A000000
24 | #8A000000
25 | #FFF6F6F6
26 | #FF00BEA4
27 |
28 |
--------------------------------------------------------------------------------
/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 60dp
4 | 30dp
5 | 1dp
6 | 3dp
7 |
8 | - 0.6
9 |
10 |
--------------------------------------------------------------------------------
/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
28 |
29 |
30 |
33 |
34 |
--------------------------------------------------------------------------------
/src/com/wildsmith/material/core/CoreMaterialApplication.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.core;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 |
6 | public class CoreMaterialApplication extends Application {
7 |
8 | private static CoreMaterialApplication application = null;
9 |
10 | @Override
11 | public void onCreate() {
12 | super.onCreate();
13 | application = this;
14 | }
15 |
16 | public static Context getContext() {
17 | return application != null ? application.getBaseContext() : null;
18 | }
19 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/core/CoreMaterialFragment.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.core;
2 |
3 | import android.app.Activity;
4 | import android.app.Fragment;
5 | import android.os.Bundle;
6 |
7 | public abstract class CoreMaterialFragment extends Fragment {
8 |
9 | protected CoreMaterialFragmentListener mCallback;
10 |
11 | public interface CoreMaterialFragmentListener {
12 |
13 | public void setCurrentFragmentTag(String tag);
14 | }
15 |
16 | @Override
17 | public void onAttach(Activity activity) {
18 | super.onAttach(activity);
19 |
20 | try {
21 | mCallback = (CoreMaterialFragmentListener) activity;
22 | } catch (ClassCastException e) {
23 | throw new ClassCastException(activity.toString() + " must implement CoreMaterialFragmentListener");
24 | }
25 | }
26 |
27 | @Override
28 | public void onCreate(Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 |
31 | setRetainInstance(true);
32 | }
33 |
34 | @Override
35 | public void onResume() {
36 | super.onResume();
37 |
38 | mCallback.setCurrentFragmentTag(getFragmentTag());
39 | }
40 |
41 | public abstract String getFragmentTag();
42 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/core/CoreMaterialListFragment.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.core;
2 |
3 | import android.app.Activity;
4 | import android.app.ListFragment;
5 | import android.os.Bundle;
6 |
7 | public abstract class CoreMaterialListFragment extends ListFragment {
8 |
9 | protected CoreMaterialListFragmentListener mCallback;
10 |
11 | public interface CoreMaterialListFragmentListener {
12 |
13 | public void setCurrentFragmentTag(String tag);
14 | }
15 |
16 | @Override
17 | public void onAttach(Activity activity) {
18 | super.onAttach(activity);
19 |
20 | try {
21 | mCallback = (CoreMaterialListFragmentListener) activity;
22 | } catch (ClassCastException e) {
23 | throw new ClassCastException(activity.toString() + " must implement CoreMaterialFragmentListener");
24 | }
25 | }
26 |
27 | @Override
28 | public void onCreate(Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 |
31 | setRetainInstance(true);
32 | }
33 |
34 | @Override
35 | public void onResume() {
36 | super.onResume();
37 |
38 | mCallback.setCurrentFragmentTag(getFragmentTag());
39 | }
40 |
41 | public abstract String getFragmentTag();
42 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/drawer/DrawerListRowAdapter.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.drawer;
2 |
3 | import java.util.List;
4 |
5 | import android.content.Context;
6 | import android.util.Log;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 |
11 | import com.wildsmith.material.list.ListRow;
12 | import com.wildsmith.material.list.expandable.AnimatedExpandableListAdapter;
13 | import com.wildsmith.material.list.expandable.AnimatedExpandableListView;
14 | import com.wildsmith.material.list.expandable.ExpandableListRow;
15 |
16 | public class DrawerListRowAdapter extends AnimatedExpandableListAdapter {
17 |
18 | private static final String TAG = DrawerListRowAdapter.class.getSimpleName();
19 |
20 | private List mRows;
21 |
22 | private LayoutInflater mInflater;
23 |
24 | protected Context mContext;
25 |
26 | public DrawerListRowAdapter(AnimatedExpandableListView expandableListView, Context pContext) {
27 | super(expandableListView);
28 |
29 | mInflater = LayoutInflater.from(pContext);
30 | mContext = pContext;
31 | }
32 |
33 | @Override
34 | public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
35 | ListRow mRow = getGroup(groupPosition);
36 | if (mRow == null) {
37 | return null;
38 | }
39 |
40 | try {
41 | View view = mRow.getView(mInflater, convertView, mContext, groupPosition);
42 | return view;
43 | } catch (Exception e) {
44 | Log.e(TAG, "Could not create the given row for group position: " + groupPosition + "." + e.getMessage());
45 | }
46 |
47 | return null;
48 | }
49 |
50 | @Override
51 | public View getRealChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
52 | ListRow mRow = getChild(groupPosition, childPosition);
53 | if (mRow == null) {
54 | return null;
55 | }
56 |
57 | try {
58 | View view = mRow.getView(mInflater, convertView, mContext, childPosition);
59 | return view;
60 | } catch (Exception e) {
61 | Log.e(TAG, "Could not create the given row for group position: " + groupPosition + "." + e.getMessage());
62 | }
63 |
64 | return null;
65 | }
66 |
67 | @Override
68 | public ListRow getChild(int groupPosition, int childPosition) {
69 | ListRow listRow = getGroup(groupPosition);
70 | if (listRow == null || listRow instanceof ExpandableListRow == false) {
71 | return null;
72 | }
73 |
74 | return ((ExpandableListRow) listRow).getChild(childPosition);
75 | }
76 |
77 | @Override
78 | public int getRealChildrenCount(int groupPosition) {
79 | ListRow listRow = getGroup(groupPosition);
80 | if (listRow == null || listRow instanceof ExpandableListRow == false) {
81 | return -1;
82 | }
83 |
84 | return ((ExpandableListRow) listRow).getChildrenCount();
85 | }
86 |
87 | @Override
88 | public ListRow getGroup(int groupPosition) {
89 | if (mRows == null || mRows.isEmpty() || mRows.size() < groupPosition) {
90 | return null;
91 | }
92 |
93 | return mRows.get(groupPosition);
94 | }
95 |
96 | @Override
97 | public int getGroupCount() {
98 | if (mRows == null || mRows.isEmpty()) {
99 | return 0;
100 | }
101 |
102 | return mRows.size();
103 | }
104 |
105 | @Override
106 | public long getChildId(int groupPosition, int childPosition) {
107 | return childPosition;
108 | }
109 |
110 | @Override
111 | public long getGroupId(int groupPosition) {
112 | return groupPosition;
113 | }
114 |
115 | @Override
116 | public boolean hasStableIds() {
117 | return true;
118 | }
119 |
120 | @Override
121 | public boolean isChildSelectable(int arg0, int arg1) {
122 | return false;
123 | }
124 |
125 | public List getRows() {
126 | return mRows;
127 | }
128 |
129 | public void setRows(List rows) {
130 | mRows = rows;
131 | }
132 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/drawer/DrawerListRowFactory.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.drawer;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 | import java.util.Locale;
6 |
7 | import android.widget.TextView;
8 |
9 | import com.wildsmith.material.R;
10 | import com.wildsmith.material.core.CoreMaterialActivity;
11 | import com.wildsmith.material.drawer.rows.ChildNavigationDrawerRow;
12 | import com.wildsmith.material.drawer.rows.DividerDrawerRow;
13 | import com.wildsmith.material.drawer.rows.ExpandableDrawerRow;
14 | import com.wildsmith.material.drawer.rows.NavigationDrawerRow;
15 | import com.wildsmith.material.list.ListRow;
16 | import com.wildsmith.material.list.expandable.AnimatedExpandableListView;
17 | import com.wildsmith.material.list.expandable.ExpandableListRow;
18 | import com.wildsmith.material.utils.ResourceHelper;
19 |
20 | public class DrawerListRowFactory {
21 |
22 | public static List createDrawerListRows(CoreMaterialActivity activity, AnimatedExpandableListView listView,
23 | TextView drawerListTitle, boolean includeActionBarRow) {
24 | List rows = new ArrayList(8);
25 |
26 | String[] drawerRowTitles = ResourceHelper.getStringArray(R.array.drawer_titles);
27 | String[] drawerRowImages = ResourceHelper.getStringArray(R.array.drawer_images);
28 | if (drawerRowTitles == null || drawerRowTitles.length == 0) {
29 | return rows;
30 | }
31 |
32 | if (includeActionBarRow) {
33 | drawerListTitle.setText(drawerRowTitles[0]);
34 | }
35 |
36 | int count = 0;
37 | for (String drawerRowTitle : drawerRowTitles) {
38 | if (drawerRowTitle == null) {
39 | count++;
40 | continue;
41 | }
42 |
43 | if (count == 0) {
44 | count++;
45 | continue;
46 | }
47 |
48 | final String drawerRowImage = drawerRowImages[count];
49 |
50 | count++;
51 | List rowChildren = createDrawerListRowChildren(activity, drawerRowTitle);
52 | if (rowChildren != null && rowChildren.size() != 0) {
53 | ExpandableListRow row = new ExpandableDrawerRow(listView, drawerRowTitle, drawerRowImage);
54 | row.setChildren(rowChildren);
55 | rows.add(row);
56 | } else {
57 | ListRow row = new NavigationDrawerRow(activity, drawerRowTitle, drawerRowImage);
58 | rows.add(row);
59 | }
60 |
61 | if (count <= drawerRowTitles.length - 1) {
62 | ListRow row = new DividerDrawerRow();
63 | rows.add(row);
64 | }
65 | }
66 |
67 | return rows;
68 | }
69 |
70 | private static List createDrawerListRowChildren(CoreMaterialActivity activity, String drawerRowTitle) {
71 | List childrenRows = new ArrayList(8);
72 |
73 | drawerRowTitle = drawerRowTitle.replace(" ", "_");
74 | drawerRowTitle = drawerRowTitle.toLowerCase(Locale.getDefault());
75 | String drawerRowClasses = drawerRowTitle + "_classes";
76 | drawerRowTitle = drawerRowTitle + "_titles";
77 |
78 | final int titlesResId = ResourceHelper.getResourceIdentifier(drawerRowTitle, "array");
79 | final int classesResId = ResourceHelper.getResourceIdentifier(drawerRowClasses, "array");
80 | if (titlesResId == 0 || classesResId == 0) {
81 | return childrenRows;
82 | }
83 |
84 | String[] childenRowTitles = ResourceHelper.getStringArray(titlesResId);
85 | if (childenRowTitles == null || childenRowTitles.length == 0) {
86 | return childrenRows;
87 | }
88 |
89 | for (String childenRowTitle : childenRowTitles) {
90 | if (childenRowTitle == null) {
91 | continue;
92 | }
93 |
94 | ListRow childRow = new ChildNavigationDrawerRow(activity, classesResId, childenRowTitle);
95 | childrenRows.add(childRow);
96 | }
97 |
98 | return childrenRows;
99 | }
100 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/drawer/DrawerOnClickListener.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.drawer;
2 |
3 | import android.app.Activity;
4 | import android.app.Fragment;
5 | import android.app.FragmentManager;
6 | import android.content.Intent;
7 | import android.support.v4.widget.DrawerLayout;
8 | import android.util.Log;
9 | import android.view.View;
10 | import android.view.View.OnClickListener;
11 | import android.widget.LinearLayout;
12 |
13 | import com.wildsmith.material.core.CoreMaterialActivity;
14 | import com.wildsmith.material.core.CoreMaterialFragment;
15 | import com.wildsmith.material.core.CoreMaterialListFragment;
16 | import com.wildsmith.material.interstitial.InterstitialActivity;
17 | import com.wildsmith.material.utils.ResourceHelper;
18 |
19 | public class DrawerOnClickListener implements OnClickListener {
20 |
21 | private static final String TAG = DrawerOnClickListener.class.getSimpleName();
22 |
23 | private CoreMaterialActivity mActivity;
24 |
25 | private LinearLayout mDrawer;
26 |
27 | private DrawerLayout mDrawerLayout;
28 |
29 | private String[] mClasses;
30 |
31 | private int mPosition;
32 |
33 | private boolean mIsParent;
34 |
35 | public DrawerOnClickListener(CoreMaterialActivity activity, LinearLayout drawer, DrawerLayout drawerLayout, int resId, int position,
36 | boolean isParent) {
37 | mActivity = activity;
38 | mDrawer = drawer;
39 | mDrawerLayout = drawerLayout;
40 | mClasses = ResourceHelper.getStringArray(resId);
41 | mPosition = position;
42 | mIsParent = isParent;
43 | }
44 |
45 | @Override
46 | public void onClick(View v) {
47 | int position = mPosition;
48 | if (mIsParent) {
49 | position = adjustPostionForDividerRows(mClasses.length, mPosition);
50 | }
51 | selectItem(position);
52 | }
53 |
54 | public void selectItem(int position) {
55 | Fragment fragment = null;
56 | Activity activity = null;
57 |
58 | try {
59 | Class> cls = Class.forName(mClasses[position]);
60 | if (cls != null) {
61 | Object potential = cls.newInstance();
62 | if (potential instanceof Fragment) {
63 | fragment = (Fragment) potential;
64 | } else if (potential instanceof Activity) {
65 | activity = (Activity) potential;
66 | }
67 | }
68 | } catch (Exception e) {
69 | Log.e(TAG, "Could not create the requested material class." + e.getMessage());
70 | return;
71 | }
72 |
73 | if (fragment != null) {
74 | handleFragmentItemClick(fragment);
75 | } else if (activity != null) {
76 | handleActivityItemClick(activity);
77 | }
78 |
79 | if (mDrawerLayout != null) {
80 | mDrawerLayout.closeDrawer(mDrawer);
81 | }
82 | }
83 |
84 | private int adjustPostionForDividerRows(int length, int index) {
85 | if (index <= 1) {
86 | return index;
87 | }
88 |
89 | return (index / 2) + 1;
90 | }
91 |
92 | private void handleFragmentItemClick(Fragment fragment) {
93 | FragmentManager fm = mActivity.getFragmentManager();
94 | Fragment stackedFragment = fm.findFragmentByTag(mActivity.getCurrentFragmentTag());
95 | if (fragment.getClass().equals(stackedFragment.getClass())) {
96 | return;
97 | }
98 |
99 | String fragmentTag = null;
100 | if (fragment instanceof CoreMaterialFragment) {
101 | fragmentTag = ((CoreMaterialFragment) fragment).getFragmentTag();
102 | } else if (fragment instanceof CoreMaterialListFragment) {
103 | fragmentTag = ((CoreMaterialListFragment) fragment).getFragmentTag();
104 | }
105 |
106 | if (fragment instanceof CoreMaterialFragment || fragment instanceof CoreMaterialListFragment) {
107 | mActivity.replaceFragment(fragment, fragmentTag);
108 | }
109 | }
110 |
111 | private void handleActivityItemClick(Activity activity) {
112 | if (activity.getClass().equals(mActivity.getClass())) {
113 | return;
114 | }
115 |
116 | Intent intent = new Intent(mActivity, activity.getClass());
117 | mActivity.startActivity(intent);
118 |
119 | if (mActivity instanceof InterstitialActivity == false) {
120 | // mActivity.finishAfterTransition();
121 | mActivity.finish();
122 | }
123 | }
124 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/drawer/DrawerToggleListener.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.drawer;
2 |
3 | import android.app.Activity;
4 | import android.support.v4.app.ActionBarDrawerToggle;
5 | import android.support.v4.widget.DrawerLayout;
6 | import android.view.View;
7 |
8 | public class DrawerToggleListener extends ActionBarDrawerToggle {
9 |
10 | private Activity mActivity;
11 |
12 | public DrawerToggleListener(Activity activity, DrawerLayout drawerLayout, int drawerImageRes, int openDrawerContentDescRes,
13 | int closeDrawerContentDescRes) {
14 | super(activity, drawerLayout, drawerImageRes, openDrawerContentDescRes, closeDrawerContentDescRes);
15 |
16 | mActivity = activity;
17 | }
18 |
19 | @Override
20 | public void onDrawerClosed(View view) {
21 | super.onDrawerClosed(view);
22 | mActivity.invalidateOptionsMenu();
23 | }
24 |
25 | @Override
26 | public void onDrawerOpened(View drawerView) {
27 | super.onDrawerOpened(drawerView);
28 | mActivity.invalidateOptionsMenu();
29 | }
30 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/drawer/rows/ChildNavigationDrawerRow.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.drawer.rows;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.widget.LinearLayout;
7 | import android.widget.TextView;
8 |
9 | import com.wildsmith.material.R;
10 | import com.wildsmith.material.core.CoreMaterialActivity;
11 | import com.wildsmith.material.core.CoreMaterialApplication;
12 | import com.wildsmith.material.list.ListRow;
13 |
14 | public class ChildNavigationDrawerRow extends ListRow {
15 |
16 | private CoreMaterialActivity mActivity;
17 |
18 | private int mClassesId;
19 |
20 | private String mChildRowText;
21 |
22 | public ChildNavigationDrawerRow(CoreMaterialActivity activity, int classesId, String childRowText) {
23 | mActivity = activity;
24 | mClassesId = classesId;
25 | mChildRowText = childRowText;
26 | }
27 |
28 | @Override
29 | public View getView(LayoutInflater inflater, View contentView, Context context, int position) {
30 | ViewHolder holder = null;
31 | if (contentView == null) {
32 | contentView =
33 | inflater.inflate(R.layout.drawer_child_navigation_row, new LinearLayout(CoreMaterialApplication.getContext()), false);
34 | holder = createViewHolder(contentView);
35 | } else {
36 | Object contentViewHolder = contentView.getTag();
37 | if (contentViewHolder instanceof ViewHolder == false) {
38 | contentView =
39 | inflater.inflate(R.layout.drawer_child_navigation_row, new LinearLayout(CoreMaterialApplication.getContext()),
40 | false);
41 | holder = createViewHolder(contentView);
42 | } else {
43 | holder = (ViewHolder) contentViewHolder;
44 | }
45 | }
46 |
47 | if (holder == null) {
48 | return contentView;
49 | }
50 |
51 | if (holder.text != null) {
52 | holder.text.setText(mChildRowText);
53 | holder.text.setOnClickListener(mActivity.createNewChildDrawerOnClickListener(mClassesId, position));
54 | }
55 |
56 | return contentView;
57 | }
58 |
59 | private ViewHolder createViewHolder(View contentView) {
60 | ViewHolder viewHolder = new ViewHolder();
61 | if (contentView == null) {
62 | return viewHolder;
63 | }
64 |
65 | viewHolder.text = (TextView) contentView.findViewById(R.id.text);
66 |
67 | contentView.setTag(viewHolder);
68 |
69 | return viewHolder;
70 | }
71 |
72 | private class ViewHolder {
73 |
74 | TextView text;
75 | }
76 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/drawer/rows/DividerDrawerRow.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.drawer.rows;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.widget.LinearLayout;
7 |
8 | import com.wildsmith.material.R;
9 | import com.wildsmith.material.core.CoreMaterialApplication;
10 | import com.wildsmith.material.list.ListRow;
11 |
12 | public class DividerDrawerRow extends ListRow {
13 |
14 | @Override
15 | public View getView(LayoutInflater inflater, View contentView, Context context, int position) {
16 | ViewHolder holder = null;
17 | if (contentView == null) {
18 | contentView = inflater.inflate(R.layout.drawer_divider_row, new LinearLayout(CoreMaterialApplication.getContext()), false);
19 | holder = createViewHolder(contentView);
20 | } else {
21 | Object contentViewHolder = contentView.getTag();
22 | if (contentViewHolder instanceof ViewHolder == false) {
23 | contentView = inflater.inflate(R.layout.drawer_divider_row, new LinearLayout(CoreMaterialApplication.getContext()), false);
24 | holder = createViewHolder(contentView);
25 | } else {
26 | holder = (ViewHolder) contentViewHolder;
27 | }
28 | }
29 |
30 | if (holder == null) {
31 | return contentView;
32 | }
33 |
34 | return contentView;
35 | }
36 |
37 | private ViewHolder createViewHolder(View contentView) {
38 | ViewHolder viewHolder = new ViewHolder();
39 | if (contentView == null) {
40 | return viewHolder;
41 | }
42 |
43 | contentView.setTag(viewHolder);
44 |
45 | return viewHolder;
46 | }
47 |
48 | private class ViewHolder {
49 |
50 | }
51 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/drawer/rows/NavigationDrawerRow.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.drawer.rows;
2 |
3 | import android.content.Context;
4 | import android.graphics.drawable.Drawable;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.widget.ImageView;
8 | import android.widget.LinearLayout;
9 | import android.widget.TextView;
10 |
11 | import com.wildsmith.material.R;
12 | import com.wildsmith.material.core.CoreMaterialActivity;
13 | import com.wildsmith.material.core.CoreMaterialApplication;
14 | import com.wildsmith.material.drawer.DrawerOnClickListener;
15 | import com.wildsmith.material.list.ListRow;
16 | import com.wildsmith.material.utils.ResourceHelper;
17 | import com.wildsmith.material.views.ViewHelper;
18 |
19 | public class NavigationDrawerRow extends ListRow {
20 |
21 | private CoreMaterialActivity mActivity;
22 |
23 | private String mNavigationText;
24 |
25 | private DrawerOnClickListener mDrawerOnClickListener;
26 |
27 | private int mNavigationImageId;
28 |
29 | public NavigationDrawerRow(CoreMaterialActivity activity, String navigationText, String navigationImage) {
30 | mActivity = activity;
31 | mNavigationText = navigationText;
32 | mNavigationImageId = ResourceHelper.getResourceIdentifier(navigationImage, "drawable");
33 | }
34 |
35 | @Override
36 | public View getView(LayoutInflater inflater, View contentView, Context context, int position) {
37 | ViewHolder holder = null;
38 | if (contentView == null) {
39 | contentView = inflater.inflate(R.layout.drawer_navigation_row, new LinearLayout(CoreMaterialApplication.getContext()), false);
40 | holder = createViewHolder(contentView);
41 | } else {
42 | Object contentViewHolder = contentView.getTag();
43 | if (contentViewHolder instanceof ViewHolder == false) {
44 | contentView =
45 | inflater.inflate(R.layout.drawer_navigation_row, new LinearLayout(CoreMaterialApplication.getContext()), false);
46 | holder = createViewHolder(contentView);
47 | } else {
48 | holder = (ViewHolder) contentViewHolder;
49 | }
50 | }
51 |
52 | if (holder == null) {
53 | return contentView;
54 | }
55 |
56 | if (holder.text != null) {
57 | holder.text.setText(mNavigationText);
58 | }
59 |
60 | if (holder.image != null && holder.image.getTag() == null) {
61 | final int color = ResourceHelper.getColor(R.color.drawer_icon_not_selected_color);
62 | Drawable drawable = ViewHelper.changeDrawableColor(mNavigationImageId, color);
63 | holder.image.setImageDrawable(drawable);
64 | holder.image.setTag(0);
65 | }
66 |
67 | setupRowClickListener(holder, position);
68 |
69 | return contentView;
70 | }
71 |
72 | private void setupRowClickListener(final ViewHolder holder, int position) {
73 | if (holder.row == null) {
74 | return;
75 | }
76 |
77 | if (mDrawerOnClickListener == null) {
78 | mDrawerOnClickListener = mActivity.createNewDrawerOnClickListener(position);
79 | }
80 |
81 | holder.row.setOnClickListener(new View.OnClickListener() {
82 |
83 | @Override
84 | public void onClick(View v) {
85 | holder.text.setTextColor(ResourceHelper.getColor(R.color.drawer_item_selected_color));
86 |
87 | final int newColor = ResourceHelper.getColor(R.color.drawer_icon_selected_color);
88 | Drawable newDrawable = ViewHelper.changeDrawableColor(mNavigationImageId, newColor);
89 | holder.image.setImageDrawable(newDrawable);
90 |
91 | mDrawerOnClickListener.onClick(v);
92 | }
93 | });
94 | }
95 |
96 | private ViewHolder createViewHolder(View contentView) {
97 | ViewHolder viewHolder = new ViewHolder();
98 | if (contentView == null) {
99 | return viewHolder;
100 | }
101 |
102 | viewHolder.row = (LinearLayout) contentView.findViewById(R.id.navigation_row);
103 | viewHolder.text = (TextView) contentView.findViewById(R.id.text);
104 | viewHolder.image = (ImageView) contentView.findViewById(R.id.image);
105 |
106 | contentView.setTag(viewHolder);
107 |
108 | return viewHolder;
109 | }
110 |
111 | private class ViewHolder {
112 |
113 | LinearLayout row;
114 |
115 | TextView text;
116 |
117 | ImageView image;
118 | }
119 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/interstitial/InterstitialActivity.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.interstitial;
2 |
3 | import android.app.ActionBar;
4 | import android.graphics.Color;
5 | import android.graphics.drawable.ColorDrawable;
6 | import android.os.Bundle;
7 |
8 | import com.wildsmith.material.R;
9 | import com.wildsmith.material.core.CoreMaterialActivity;
10 |
11 | public class InterstitialActivity extends CoreMaterialActivity {
12 |
13 | private InterstitialFragment interstitialFragment;
14 |
15 | @Override
16 | protected void onCreate(Bundle savedInstanceState) {
17 | super.onCreate(savedInstanceState);
18 |
19 | ActionBar actionBar = getActionBar();
20 | actionBar.show();
21 | actionBar.setTitle(null);
22 | actionBar.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
23 |
24 | interstitialFragment = new InterstitialFragment();
25 | addFragment(interstitialFragment, InterstitialFragment.TAG);
26 | }
27 |
28 | @Override
29 | protected int getNavigationResource() {
30 | return R.drawable.ic_drawer;
31 | }
32 |
33 | @Override
34 | protected boolean isActionBarNecessary() {
35 | return true;
36 | }
37 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/interstitial/InterstitialFragment.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.interstitial;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import com.wildsmith.material.R;
10 | import com.wildsmith.material.core.CoreMaterialFragment;
11 | import com.wildsmith.material.presentation.uitopics.WhatIsMaterialActivity;
12 | import com.wildsmith.material.utils.ResourceHelper;
13 | import com.wildsmith.material.views.FloatingActionButton;
14 |
15 | public class InterstitialFragment extends CoreMaterialFragment {
16 |
17 | public static final String TAG = InterstitialFragment.class.getSimpleName();
18 |
19 | @Override
20 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
21 | View view = inflater.inflate(R.layout.interstitial_layout, container, false);
22 | return view;
23 | }
24 |
25 | @Override
26 | public void onViewCreated(View view, Bundle savedInstanceState) {
27 | super.onViewCreated(view, savedInstanceState);
28 | if (view == null) {
29 | return;
30 | }
31 |
32 | setupInterstitialFAB(view);
33 | }
34 |
35 | private void setupInterstitialFAB(View view) {
36 | FloatingActionButton fabButton = (FloatingActionButton) view.findViewById(R.id.fab_button);
37 | if (fabButton == null) {
38 | return;
39 | }
40 |
41 | fabButton.setImageDrawableColor(ResourceHelper.getColor(R.color.interstitial_fab_color));
42 |
43 | fabButton.setOnClickListener(new View.OnClickListener() {
44 |
45 | @Override
46 | public void onClick(View v) {
47 | View root = getView();
48 | if (root == null) {
49 | return;
50 | }
51 |
52 | Intent intent = new Intent(getActivity(), WhatIsMaterialActivity.class);
53 | getActivity().startActivity(intent);
54 | }
55 | });
56 | }
57 |
58 | @Override
59 | public String getFragmentTag() {
60 | return TAG;
61 | }
62 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/list/ListRow.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.list;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 |
7 | public abstract class ListRow {
8 |
9 | public abstract View getView(LayoutInflater inflater, View contentView, Context context, int position);
10 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/list/ListRowAdapter.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.list;
2 |
3 | import java.util.List;
4 |
5 | import android.content.Context;
6 | import android.util.Log;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 | import android.widget.ArrayAdapter;
11 |
12 | public class ListRowAdapter extends ArrayAdapter {
13 |
14 | private static final String TAG = ListRowAdapter.class.getSimpleName();
15 |
16 | protected List mRows;
17 |
18 | protected LayoutInflater mInflater;
19 |
20 | protected Context mContext;
21 |
22 | public ListRowAdapter(Context pContext, int pViewResourceId) {
23 | super(pContext, pViewResourceId);
24 |
25 | mInflater = LayoutInflater.from(pContext);
26 | mContext = pContext;
27 | }
28 |
29 | @Override
30 | public View getView(int position, View convertView, ViewGroup parent) {
31 | ListRow mRow = getRow(position);
32 | if (mRow == null) {
33 | return null;
34 | }
35 |
36 | try {
37 | View view = mRow.getView(mInflater, convertView, mContext, position);
38 | return view;
39 | } catch (Exception e) {
40 | Log.e(TAG, "Could not create the given row for position: " + position + "." + e.getMessage());
41 | }
42 |
43 | return null;
44 | }
45 |
46 | public List getRows() {
47 | return mRows;
48 | }
49 |
50 | public void setRows(List rows) {
51 | mRows = rows;
52 | }
53 |
54 | @Override
55 | public long getItemId(int position) {
56 | return position;
57 | }
58 |
59 | @Override
60 | public int getCount() {
61 | if (mRows == null || mRows.isEmpty()) {
62 | return 0;
63 | }
64 |
65 | return mRows.size();
66 | }
67 |
68 | public ListRow getRow(int position) {
69 | if (mRows == null || mRows.isEmpty() || mRows.size() < position) {
70 | return null;
71 | }
72 |
73 | return mRows.get(position);
74 | }
75 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/list/expandable/AnimatedExpandableListView.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.list.expandable;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.View;
6 | import android.widget.ExpandableListAdapter;
7 | import android.widget.ExpandableListView;
8 |
9 | public class AnimatedExpandableListView extends ExpandableListView {
10 |
11 | public static final int ANIMATION_DURATION = 300;
12 |
13 | private AnimatedExpandableListAdapter adapter;
14 |
15 | public AnimatedExpandableListView(Context context) {
16 | super(context);
17 | }
18 |
19 | public AnimatedExpandableListView(Context context, AttributeSet attrs) {
20 | super(context, attrs);
21 | }
22 |
23 | public AnimatedExpandableListView(Context context, AttributeSet attrs, int defStyle) {
24 | super(context, attrs, defStyle);
25 | }
26 |
27 | @Override
28 | public void setAdapter(ExpandableListAdapter adapter) {
29 | super.setAdapter(adapter);
30 |
31 | if (adapter instanceof AnimatedExpandableListAdapter) {
32 | this.adapter = (AnimatedExpandableListAdapter) adapter;
33 | } else {
34 | throw new ClassCastException(adapter.toString() + " must implement AnimatedExpandableListAdapter");
35 | }
36 | }
37 |
38 | public boolean expandGroupWithAnimation(int groupPos) {
39 | int groupFlatPos = getFlatListPosition(getPackedPositionForGroup(groupPos));
40 | if (groupFlatPos != -1) {
41 | int childIndex = groupFlatPos - getFirstVisiblePosition();
42 | if (childIndex < getChildCount()) {
43 | View v = getChildAt(childIndex);
44 | if (v.getBottom() >= getBottom()) {
45 | adapter.notifyGroupExpanded(groupPos);
46 | return expandGroup(groupPos);
47 | }
48 | }
49 | }
50 |
51 | adapter.startExpandAnimation(groupPos, 0);
52 | return expandGroup(groupPos);
53 | }
54 |
55 | public boolean collapseGroupWithAnimation(int groupPos) {
56 | int groupFlatPos = getFlatListPosition(getPackedPositionForGroup(groupPos));
57 | if (groupFlatPos != -1) {
58 | int childIndex = groupFlatPos - getFirstVisiblePosition();
59 | if (childIndex >= 0 && childIndex < getChildCount()) {
60 | View v = getChildAt(childIndex);
61 | if (v.getBottom() >= getBottom()) {
62 | return collapseGroup(groupPos);
63 | }
64 | } else {
65 | return collapseGroup(groupPos);
66 | }
67 | }
68 |
69 | long packedPos = getExpandableListPosition(getFirstVisiblePosition());
70 | int firstChildPos = getPackedPositionChild(packedPos);
71 | int firstGroupPos = getPackedPositionGroup(packedPos);
72 |
73 | firstChildPos = firstChildPos == -1 || firstGroupPos != groupPos ? 0 : firstChildPos;
74 |
75 | adapter.startCollapseAnimation(groupPos, firstChildPos);
76 |
77 | adapter.notifyDataSetChanged();
78 | return isGroupExpanded(groupPos);
79 | }
80 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/list/expandable/ExpandCollapseAnimation.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.list.expandable;
2 |
3 | import android.view.View;
4 | import android.view.animation.Animation;
5 | import android.view.animation.Transformation;
6 |
7 | public class ExpandCollapseAnimation extends Animation {
8 |
9 | private ExpandableListStateHolder mStateHolder;
10 |
11 | private View mView;
12 |
13 | private int mBaseHeight;
14 |
15 | private int mDelta;
16 |
17 | public ExpandCollapseAnimation(View v, int startHeight, int endHeight, ExpandableListStateHolder stateHolder) {
18 | mBaseHeight = startHeight;
19 | mDelta = endHeight - startHeight;
20 | mView = v;
21 | mStateHolder = stateHolder;
22 |
23 | mView.getLayoutParams().height = startHeight;
24 | mView.requestLayout();
25 | }
26 |
27 | @Override
28 | protected void applyTransformation(float interpolatedTime, Transformation t) {
29 | super.applyTransformation(interpolatedTime, t);
30 | if (interpolatedTime < 1.0f) {
31 | int val = mBaseHeight + (int) (mDelta * interpolatedTime);
32 | mView.getLayoutParams().height = val;
33 | mStateHolder.setDummyHeight(val);
34 | mView.requestLayout();
35 | } else {
36 | int val = mBaseHeight + mDelta;
37 | mView.getLayoutParams().height = val;
38 | mStateHolder.setDummyHeight(val);
39 | mView.requestLayout();
40 | }
41 | }
42 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/list/expandable/ExpandableListDummyView.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.list.expandable;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import android.content.Context;
7 | import android.graphics.Canvas;
8 | import android.graphics.drawable.Drawable;
9 | import android.view.View;
10 |
11 | public class ExpandableListDummyView extends View {
12 |
13 | private List views = new ArrayList(8);
14 |
15 | private Drawable divider;
16 |
17 | private int dividerWidth;
18 |
19 | private int dividerHeight;
20 |
21 | public ExpandableListDummyView(Context context) {
22 | super(context);
23 | }
24 |
25 | public void setDivider(Drawable divider, int dividerWidth, int dividerHeight) {
26 | this.divider = divider;
27 | this.dividerWidth = dividerWidth;
28 | this.dividerHeight = dividerHeight;
29 |
30 | divider.setBounds(0, 0, dividerWidth, dividerHeight);
31 | }
32 |
33 | /**
34 | * Add a view for the DummyView to draw.
35 | *
36 | * @param childView View to draw
37 | */
38 | public void addFakeView(View childView) {
39 | childView.layout(0, 0, getWidth(), getHeight());
40 | views.add(childView);
41 | }
42 |
43 | @Override
44 | protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
45 | super.onLayout(changed, left, top, right, bottom);
46 | final int len = views.size();
47 | for (int i = 0; i < len; i++) {
48 | View v = views.get(i);
49 | v.layout(left, top, right, bottom);
50 | }
51 | }
52 |
53 | public void clearViews() {
54 | views.clear();
55 | }
56 |
57 | @Override
58 | public void dispatchDraw(Canvas canvas) {
59 | canvas.save();
60 |
61 | divider.setBounds(0, 0, dividerWidth, dividerHeight);
62 |
63 | final int len = views.size();
64 | for (int i = 0; i < len; i++) {
65 | View v = views.get(i);
66 | v.draw(canvas);
67 | canvas.translate(0, v.getMeasuredHeight());
68 | divider.draw(canvas);
69 | canvas.translate(0, dividerHeight);
70 | }
71 |
72 | canvas.restore();
73 | }
74 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/list/expandable/ExpandableListRow.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.list.expandable;
2 |
3 | import java.util.List;
4 |
5 | import com.wildsmith.material.list.ListRow;
6 |
7 | public abstract class ExpandableListRow extends ListRow {
8 |
9 | private List mExpandableListChildren;
10 |
11 | public ListRow getChild(int position) {
12 | if (mExpandableListChildren == null || mExpandableListChildren.size() == 0) {
13 | return null;
14 | }
15 |
16 | return mExpandableListChildren.get(position);
17 | }
18 |
19 | public int getChildrenCount() {
20 | if (mExpandableListChildren == null || mExpandableListChildren.size() == 0) {
21 | return 0;
22 | }
23 |
24 | return mExpandableListChildren.size();
25 | }
26 |
27 | public void setChildren(List expandableListChildren) {
28 | mExpandableListChildren = expandableListChildren;
29 | }
30 |
31 | public List getChildren() {
32 | return mExpandableListChildren;
33 | }
34 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/list/expandable/ExpandableListStateHolder.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.list.expandable;
2 |
3 | public class ExpandableListStateHolder {
4 |
5 | private boolean mIsAnimating;
6 |
7 | private boolean mIsExpanding;
8 |
9 | private int mFirstChildPosition;
10 |
11 | private int mDummyHeight = -1;
12 |
13 | public boolean isAnimating() {
14 | return mIsAnimating;
15 | }
16 |
17 | public void setAnimating(boolean mIsAnimating) {
18 | this.mIsAnimating = mIsAnimating;
19 | }
20 |
21 | public boolean isExpanding() {
22 | return mIsExpanding;
23 | }
24 |
25 | public void setExpanding(boolean mIsExpanding) {
26 | this.mIsExpanding = mIsExpanding;
27 | }
28 |
29 | public int getFirstChildPosition() {
30 | return mFirstChildPosition;
31 | }
32 |
33 | public void setFirstChildPosition(int mFirstChildPosition) {
34 | this.mFirstChildPosition = mFirstChildPosition;
35 | }
36 |
37 | public int getDummyHeight() {
38 | return mDummyHeight;
39 | }
40 |
41 | public void setDummyHeight(int mDummyHeight) {
42 | this.mDummyHeight = mDummyHeight;
43 | }
44 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/playground/PlaygroundActivity.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.playground;
2 |
3 | import android.app.ActionBar;
4 | import android.os.Bundle;
5 |
6 | import com.wildsmith.material.R;
7 | import com.wildsmith.material.core.CoreMaterialActivity;
8 |
9 | public class PlaygroundActivity extends CoreMaterialActivity {
10 |
11 | private PlaygroundFragment playgroundFragment;
12 |
13 | @Override
14 | protected void onCreate(Bundle savedInstanceState) {
15 | super.onCreate(savedInstanceState);
16 |
17 | ActionBar actionBar = getActionBar();
18 | actionBar.show();
19 |
20 | // getWindow().setAllowEnterTransitionOverlap(true);
21 | // getWindow().setAllowExitTransitionOverlap(true);
22 |
23 | playgroundFragment = new PlaygroundFragment();
24 | addFragment(playgroundFragment, PlaygroundFragment.TAG);
25 | }
26 |
27 | @Override
28 | protected int getNavigationResource() {
29 | return R.drawable.ic_drawer;
30 | }
31 |
32 | @Override
33 | protected boolean isActionBarNecessary() {
34 | return true;
35 | }
36 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/playground/PlaygroundListRowAdapter.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.playground;
2 |
3 | import android.content.Context;
4 | import android.util.Log;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 |
8 | import com.wildsmith.material.list.ListRow;
9 | import com.wildsmith.material.list.ListRowAdapter;
10 | import com.wildsmith.material.playground.rows.PlaygroundActionBarCardRow;
11 | import com.wildsmith.material.playground.rows.PlaygroundActionCardRow;
12 | import com.wildsmith.material.playground.rows.PlaygroundElevationCardRow;
13 | import com.wildsmith.material.playground.rows.PlaygroundNavigationCardRow;
14 |
15 | public class PlaygroundListRowAdapter extends ListRowAdapter {
16 |
17 | private static final String TAG = PlaygroundListRowAdapter.class.getSimpleName();
18 |
19 | // private int mPosition;
20 |
21 | public PlaygroundListRowAdapter(Context pContext, int pViewResourceId) {
22 | super(pContext, pViewResourceId);
23 | }
24 |
25 | @Override
26 | public View getView(int position, View convertView, ViewGroup parent) {
27 | ListRow mRow = getRow(position);
28 | if (mRow == null) {
29 | return null;
30 | }
31 |
32 | try {
33 | View view = mRow.getView(mInflater, convertView, mContext, position);
34 |
35 | // if (mPosition > position) {
36 | // animateViewDown(view);
37 | // } else if (mPosition < position) {
38 | // animateViewUp(view);
39 | // }
40 |
41 | // mPosition = position;
42 |
43 | return view;
44 | } catch (Exception e) {
45 | Log.e(TAG, "Could not create the given row for position: " + position + "." + e.getMessage());
46 | }
47 |
48 | return null;
49 | }
50 |
51 | // private void animateViewUp(View view) {
52 | // // get the center for the clipping circle
53 | // int cx = (view.getLeft() + view.getRight()) / 2;
54 | //
55 | // // get the final radius for the clipping circle
56 | // int finalRadius = view.getWidth();
57 | //
58 | // // create and start the animator for this view
59 | // // (the start radius is zero)
60 | // ValueAnimator anim = ViewAnimationUtils.createCircularReveal(view, cx, view.getBottom(), 0,
61 | // finalRadius);
62 | // anim.start();
63 | // }
64 | //
65 | // private void animateViewDown(View view) {
66 | // // get the center for the clipping circle
67 | // int cx = (view.getLeft() + view.getRight()) / 2;
68 | //
69 | // // get the final radius for the clipping circle
70 | // int finalRadius = view.getWidth();
71 | //
72 | // // create and start the animator for this view
73 | // // (the start radius is zero)
74 | // ValueAnimator anim = ViewAnimationUtils.createCircularReveal(view, cx, view.getTop(), 0,
75 | // finalRadius);
76 | // anim.start();
77 | // }
78 |
79 | @Override
80 | public int getViewTypeCount() {
81 | return 4;
82 | }
83 |
84 | @Override
85 | public int getItemViewType(int position) {
86 | if (mRows == null || mRows.isEmpty() || mRows.size() < position) {
87 | return -1;
88 | }
89 |
90 | ListRow row = mRows.get(position);
91 | if (row instanceof PlaygroundActionBarCardRow) {
92 | return 0;
93 | } else if (row instanceof PlaygroundActionCardRow) {
94 | return 1;
95 | } else if (row instanceof PlaygroundNavigationCardRow) {
96 | return 2;
97 | } else if (row instanceof PlaygroundElevationCardRow) {
98 | return 3;
99 | }
100 |
101 | return -1;
102 | }
103 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/playground/detail/PlaygroundDetailActivity.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.playground.detail;
2 |
3 | import android.os.Bundle;
4 | import android.view.MenuItem;
5 |
6 | import com.wildsmith.material.R;
7 | import com.wildsmith.material.core.CoreMaterialActivity;
8 |
9 | public class PlaygroundDetailActivity extends CoreMaterialActivity {
10 |
11 | private PlaygroundDetailFragment detailFragment;
12 |
13 | @Override
14 | protected void onCreate(Bundle savedInstanceState) {
15 | super.onCreate(savedInstanceState);
16 |
17 | // getWindow().setAllowEnterTransitionOverlap(true);
18 | // getWindow().setAllowExitTransitionOverlap(true);
19 |
20 | detailFragment = PlaygroundDetailFragment.newInstance(mActionBarShowing);
21 | addFragment(detailFragment, PlaygroundDetailFragment.TAG);
22 | }
23 |
24 | @Override
25 | public boolean onOptionsItemSelected(MenuItem item) {
26 | switch (item.getItemId()) {
27 | case android.R.id.home:
28 | // finishAfterTransition();
29 | finish();
30 | return true;
31 | }
32 | return super.onOptionsItemSelected(item);
33 | }
34 |
35 | @Override
36 | protected int getNavigationResource() {
37 | return R.drawable.ic_action_back_white;
38 | }
39 |
40 | @Override
41 | protected boolean isActionBarNecessary() {
42 | return true;
43 | }
44 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/playground/detail/PlaygroundDetailFragment.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.playground.detail;
2 |
3 | import android.os.Bundle;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 |
8 | import com.wildsmith.material.R;
9 | import com.wildsmith.material.core.CoreMaterialFragment;
10 |
11 | public class PlaygroundDetailFragment extends CoreMaterialFragment {
12 |
13 | public static final String TAG = PlaygroundDetailFragment.class.getSimpleName();
14 |
15 | private Boolean actionBarShowing;
16 |
17 | @Override
18 | public void onCreate(Bundle savedInstanceState) {
19 | super.onCreate(savedInstanceState);
20 |
21 | Bundle bundle = getArguments();
22 | actionBarShowing = bundle.getBoolean("ActionBarShowing");
23 |
24 | setRetainInstance(true);
25 | }
26 |
27 | @Override
28 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
29 | View view = inflater.inflate(R.layout.playground_detail_layout, container, false);
30 | return view;
31 | }
32 |
33 | @Override
34 | public void onViewCreated(View view, Bundle savedInstanceState) {
35 | super.onViewCreated(view, savedInstanceState);
36 | if (view == null) {
37 | return;
38 | }
39 |
40 | setupActionBar(view);
41 | }
42 |
43 | private void setupActionBar(View view) {
44 | View fakeActionBar = view.findViewById(R.id.action_bar_view);
45 | if (actionBarShowing == false) {
46 | fakeActionBar.setVisibility(View.GONE);
47 | }
48 | }
49 |
50 | public static PlaygroundDetailFragment newInstance(Boolean actionBarShowing) {
51 | PlaygroundDetailFragment detailFragment = new PlaygroundDetailFragment();
52 |
53 | Bundle bundle = new Bundle();
54 | bundle.putBoolean("ActionBarShowing", actionBarShowing);
55 | detailFragment.setArguments(bundle);
56 |
57 | return detailFragment;
58 | }
59 |
60 | @Override
61 | public String getFragmentTag() {
62 | return TAG;
63 | }
64 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/playground/rows/PlaygroundActionBarCardRow.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.playground.rows;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 |
7 | import com.wildsmith.material.R;
8 |
9 | public class PlaygroundActionBarCardRow extends PlaygroundCardListRow {
10 |
11 | @Override
12 | public View getView(LayoutInflater inflater, View contentView, Context context, int position) {
13 | ViewHolder holder = null;
14 | if (contentView == null) {
15 | contentView = inflater.inflate(R.layout.playground_action_bar_card_row, null);
16 | holder = createViewHolder(contentView, position);
17 | } else {
18 | Object contentViewHolder = contentView.getTag();
19 | if (contentViewHolder instanceof ViewHolder == false) {
20 | contentView = inflater.inflate(R.layout.playground_action_bar_card_row, null);
21 | holder = createViewHolder(contentView, position);
22 | } else {
23 | holder = (ViewHolder) contentViewHolder;
24 | }
25 | }
26 |
27 | if (holder == null) {
28 | return contentView;
29 | }
30 |
31 | return contentView;
32 | }
33 |
34 | @Override
35 | public View getTitleTextView(View view) {
36 | if (view == null) {
37 | return null;
38 | }
39 |
40 | return view.findViewById(R.id.elevation_title_text);
41 | }
42 |
43 | @Override
44 | public View getInfoTextView(View view) {
45 | if (view == null) {
46 | return null;
47 | }
48 |
49 | return view.findViewById(R.id.elevation_info_text);
50 | }
51 |
52 | private ViewHolder createViewHolder(View contentView, int position) {
53 | ViewHolder viewHolder = new ViewHolder();
54 | if (contentView == null) {
55 | return viewHolder;
56 | }
57 |
58 | viewHolder.actionBarView = contentView.findViewById(R.id.action_bar_view);
59 | // viewHolder.actionBarView.setViewName("card:view:" + position);
60 |
61 | contentView.setTag(viewHolder);
62 |
63 | return viewHolder;
64 | }
65 |
66 | private class ViewHolder {
67 |
68 | View actionBarView;
69 | }
70 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/playground/rows/PlaygroundActionCardRow.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.playground.rows;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.CardView;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 |
8 | import com.wildsmith.material.R;
9 |
10 | public class PlaygroundActionCardRow extends PlaygroundCardListRow {
11 |
12 | @Override
13 | public View getView(LayoutInflater inflater, View contentView, Context context, int position) {
14 | ViewHolder holder = null;
15 | if (contentView == null) {
16 | contentView = inflater.inflate(R.layout.playground_action_card_row, null);
17 | holder = createViewHolder(contentView, position);
18 | } else {
19 | Object contentViewHolder = contentView.getTag();
20 | if (contentViewHolder instanceof ViewHolder == false) {
21 | contentView = inflater.inflate(R.layout.playground_action_card_row, null);
22 | holder = createViewHolder(contentView, position);
23 | } else {
24 | holder = (ViewHolder) contentViewHolder;
25 | }
26 | }
27 |
28 | if (holder == null) {
29 | return contentView;
30 | }
31 |
32 | return contentView;
33 | }
34 |
35 | @Override
36 | public View getTitleTextView(View view) {
37 | if (view == null) {
38 | return null;
39 | }
40 |
41 | return view.findViewById(R.id.action_title_text);
42 | }
43 |
44 | @Override
45 | public View getInfoTextView(View view) {
46 | if (view == null) {
47 | return null;
48 | }
49 |
50 | return view.findViewById(R.id.action_edit_text);
51 | }
52 |
53 | private ViewHolder createViewHolder(View contentView, int position) {
54 | ViewHolder viewHolder = new ViewHolder();
55 | if (contentView == null) {
56 | return viewHolder;
57 | }
58 |
59 | viewHolder.cardView = (CardView) contentView.findViewById(R.id.card_view);
60 | // viewHolder.cardView.setViewName("card:view:" + position);
61 |
62 | contentView.setTag(viewHolder);
63 |
64 | return viewHolder;
65 | }
66 |
67 | private class ViewHolder {
68 |
69 | CardView cardView;
70 | }
71 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/playground/rows/PlaygroundCardListRow.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.playground.rows;
2 |
3 | import android.app.Activity;
4 | import android.view.View;
5 |
6 | import com.wildsmith.material.list.ListRow;
7 |
8 | public abstract class PlaygroundCardListRow extends ListRow {
9 |
10 | protected Activity mActivity;
11 |
12 | public abstract View getTitleTextView(View view);
13 |
14 | public abstract View getInfoTextView(View view);
15 |
16 | public void setActivity(Activity mActivity) {
17 | this.mActivity = mActivity;
18 | }
19 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/playground/rows/PlaygroundElevationCardRow.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.playground.rows;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Context;
5 | import android.support.v7.widget.CardView;
6 | import android.view.LayoutInflater;
7 | import android.view.MotionEvent;
8 | import android.view.View;
9 |
10 | import com.wildsmith.material.R;
11 |
12 | public class PlaygroundElevationCardRow extends PlaygroundCardListRow {
13 |
14 | @Override
15 | public View getView(LayoutInflater inflater, View contentView, Context context, int position) {
16 | ViewHolder holder = null;
17 | if (contentView == null) {
18 | contentView = inflater.inflate(R.layout.playground_elevation_card_row, null);
19 | holder = createViewHolder(contentView, position);
20 | } else {
21 | Object contentViewHolder = contentView.getTag();
22 | if (contentViewHolder instanceof ViewHolder == false) {
23 | contentView = inflater.inflate(R.layout.playground_elevation_card_row, null);
24 | holder = createViewHolder(contentView, position);
25 | } else {
26 | holder = (ViewHolder) contentViewHolder;
27 | }
28 | }
29 |
30 | if (holder == null) {
31 | return contentView;
32 | }
33 |
34 | setupCardViewListener(holder);
35 |
36 | return contentView;
37 | }
38 |
39 | @SuppressLint("ClickableViewAccessibility")
40 | private void setupCardViewListener(final ViewHolder holder) {
41 | if (holder.cardView == null) {
42 | return;
43 | }
44 |
45 | holder.cardView.setOnTouchListener(new View.OnTouchListener() {
46 |
47 | @Override
48 | public boolean onTouch(View view, MotionEvent motionEvent) {
49 | int action = motionEvent.getActionMasked();
50 | /* Raise view on ACTION_DOWN and lower it on ACTION_UP. */
51 | switch (action) {
52 | case MotionEvent.ACTION_DOWN:
53 | // view.setTranslationZ(20);
54 | break;
55 | case MotionEvent.ACTION_UP:
56 | // view.setTranslationZ(0);
57 | break;
58 | default:
59 | return false;
60 | }
61 | return true;
62 | }
63 | });
64 | }
65 |
66 | @Override
67 | public View getTitleTextView(View view) {
68 | if (view == null) {
69 | return null;
70 | }
71 |
72 | return view.findViewById(R.id.elevation_title_text);
73 | }
74 |
75 | @Override
76 | public View getInfoTextView(View view) {
77 | if (view == null) {
78 | return null;
79 | }
80 |
81 | return view.findViewById(R.id.elevation_info_text);
82 | }
83 |
84 | private ViewHolder createViewHolder(View contentView, int position) {
85 | ViewHolder viewHolder = new ViewHolder();
86 | if (contentView == null) {
87 | return viewHolder;
88 | }
89 |
90 | viewHolder.cardView = (CardView) contentView.findViewById(R.id.card_view);
91 | // viewHolder.cardView.setViewName("card:view:" + position);
92 |
93 | contentView.setTag(viewHolder);
94 |
95 | return viewHolder;
96 | }
97 |
98 | private class ViewHolder {
99 |
100 | CardView cardView;
101 | }
102 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/playground/rows/PlaygroundNavigationCardRow.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.playground.rows;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.support.v7.widget.CardView;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.widget.TextView;
9 |
10 | import com.wildsmith.material.R;
11 | import com.wildsmith.material.playground.detail.PlaygroundDetailActivity;
12 |
13 | public class PlaygroundNavigationCardRow extends PlaygroundCardListRow {
14 |
15 | @Override
16 | public View getView(LayoutInflater inflater, View contentView, Context context, int position) {
17 | ViewHolder holder = null;
18 | if (contentView == null) {
19 | contentView = inflater.inflate(R.layout.playground_navigation_card_row, null);
20 | holder = createViewHolder(contentView, position);
21 | } else {
22 | Object contentViewHolder = contentView.getTag();
23 | if (contentViewHolder instanceof ViewHolder == false) {
24 | contentView = inflater.inflate(R.layout.playground_navigation_card_row, null);
25 | holder = createViewHolder(contentView, position);
26 | } else {
27 | holder = (ViewHolder) contentViewHolder;
28 | }
29 | }
30 |
31 | if (holder == null) {
32 | return contentView;
33 | }
34 |
35 | setupCardViewListener(holder);
36 |
37 | return contentView;
38 | }
39 |
40 | private void setupCardViewListener(final ViewHolder holder) {
41 | if (holder.cardView == null) {
42 | return;
43 | }
44 |
45 | holder.cardView.setOnClickListener(new View.OnClickListener() {
46 |
47 | // @SuppressWarnings("unchecked")
48 | @Override
49 | public void onClick(View view) {
50 | Intent intent = new Intent(mActivity, PlaygroundDetailActivity.class);
51 | intent.putExtra("ActionBarShowing", mActivity.getActionBar().isShowing());
52 |
53 | // final View titleText = getTitleTextView(view);
54 | // final String titleViewName =
55 | // ResourceHelper.getResString(R.string.detail_title_view_name);
56 | //
57 | // final View infoText = getInfoTextView(view);
58 | // final String infoViewName =
59 | // ResourceHelper.getResString(R.string.detail_info_view_name);
60 |
61 | // ActivityOptions activityOptions =
62 | // ActivityOptions.makeSceneTransitionAnimation(mActivity, new Pair(titleText, titleViewName),
64 | // new Pair(infoText, infoViewName));
65 |
66 | // mActivity.startActivity(intent, activityOptions.toBundle());
67 | mActivity.startActivity(intent);
68 | }
69 | });
70 | }
71 |
72 | @Override
73 | public View getTitleTextView(View view) {
74 | if (view == null) {
75 | return null;
76 | }
77 |
78 | return view.findViewById(R.id.navigation_title_text);
79 | }
80 |
81 | @Override
82 | public View getInfoTextView(View view) {
83 | if (view == null) {
84 | return null;
85 | }
86 |
87 | return view.findViewById(R.id.navigation_info_text);
88 | }
89 |
90 | private ViewHolder createViewHolder(View contentView, int position) {
91 | ViewHolder viewHolder = new ViewHolder();
92 | if (contentView == null) {
93 | return viewHolder;
94 | }
95 |
96 | viewHolder.cardView = (CardView) contentView.findViewById(R.id.card_view);
97 | // viewHolder.cardView.setViewName("card:view:" + position);
98 | viewHolder.titleText = (TextView) contentView.findViewById(R.id.navigation_title_text);
99 | // viewHolder.titleText.setViewName("nav:title:" + position);
100 | viewHolder.infoText = (TextView) contentView.findViewById(R.id.navigation_info_text);
101 | // viewHolder.infoText.setViewName("nav:info:" + position);
102 |
103 | contentView.setTag(viewHolder);
104 |
105 | return viewHolder;
106 | }
107 |
108 | private class ViewHolder {
109 |
110 | CardView cardView;
111 |
112 | TextView titleText;
113 |
114 | TextView infoText;
115 | }
116 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/PresentationActivity.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation;
2 |
3 | import android.app.ActionBar;
4 | import android.graphics.Color;
5 | import android.graphics.drawable.ColorDrawable;
6 | import android.os.Bundle;
7 |
8 | import com.wildsmith.material.R;
9 | import com.wildsmith.material.core.CoreMaterialActivity;
10 |
11 | public class PresentationActivity extends CoreMaterialActivity {
12 |
13 | @Override
14 | protected void onCreate(Bundle savedInstanceState) {
15 | super.onCreate(savedInstanceState);
16 |
17 | ActionBar actionBar = getActionBar();
18 | actionBar.show();
19 | actionBar.setTitle(null);
20 | actionBar.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
21 | }
22 |
23 | @Override
24 | protected int getNavigationResource() {
25 | return R.drawable.ic_drawer;
26 | }
27 |
28 | @Override
29 | protected boolean isActionBarNecessary() {
30 | return true;
31 | }
32 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/PresentationListRowAdapter.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 | import android.view.ViewGroup;
6 | import android.widget.ListView;
7 |
8 | import com.wildsmith.material.core.CoreMaterialActivity;
9 | import com.wildsmith.material.list.ListRow;
10 | import com.wildsmith.material.list.ListRowAdapter;
11 | import com.wildsmith.material.presentation.rows.PresentationActionBarRow;
12 | import com.wildsmith.material.presentation.rows.PresentationImageRow;
13 | import com.wildsmith.material.presentation.rows.PresentationInformationRow;
14 | import com.wildsmith.material.presentation.rows.PresentationListRow;
15 | import com.wildsmith.material.presentation.rows.PresentationNavigationRow;
16 | import com.wildsmith.material.presentation.rows.PresentationTitleRow;
17 | import com.wildsmith.material.presentation.rows.PresentationVideoRow;
18 | import com.wildsmith.material.views.FloatingActionButton;
19 |
20 | public class PresentationListRowAdapter extends ListRowAdapter {
21 |
22 | private CoreMaterialActivity mActivity;
23 |
24 | private ListView mListView;
25 |
26 | private FloatingActionButton mFabButton;
27 |
28 | public PresentationListRowAdapter(Context pContext, int pViewResourceId) {
29 | super(pContext, pViewResourceId);
30 | }
31 |
32 | public void setArguments(CoreMaterialActivity activity, ListView listView, FloatingActionButton fabButton) {
33 | mActivity = activity;
34 | mListView = listView;
35 | mFabButton = fabButton;
36 | }
37 |
38 | @Override
39 | public View getView(int position, View convertView, ViewGroup parent) {
40 | PresentationListRow mRow = (PresentationListRow) getRow(position);
41 | if (mRow == null) {
42 | return null;
43 | }
44 |
45 | if (position == getCount() - 2) {
46 | mRow.setAdditionalArguments(mActivity, mListView, mFabButton, true);
47 | } else {
48 | mRow.setAdditionalArguments(mActivity, mListView, mFabButton, false);
49 | }
50 |
51 | return super.getView(position, convertView, parent);
52 | }
53 |
54 | @Override
55 | public int getViewTypeCount() {
56 | return 6;
57 | }
58 |
59 | @Override
60 | public int getItemViewType(int position) {
61 | if (mRows == null || mRows.isEmpty() || mRows.size() < position) {
62 | return -1;
63 | }
64 |
65 | ListRow row = mRows.get(position);
66 | if (row instanceof PresentationActionBarRow) {
67 | return 0;
68 | } else if (row instanceof PresentationInformationRow) {
69 | return 1;
70 | } else if (row instanceof PresentationVideoRow) {
71 | return 2;
72 | } else if (row instanceof PresentationImageRow) {
73 | return 3;
74 | } else if (row instanceof PresentationTitleRow) {
75 | return 4;
76 | } else if (row instanceof PresentationNavigationRow) {
77 | return 5;
78 | }
79 |
80 | return -1;
81 | }
82 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/PresentationSlideFactory.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import android.util.Log;
7 |
8 | import com.wildsmith.material.list.ListRow;
9 | import com.wildsmith.material.presentation.rows.PresentationActionBarRow;
10 | import com.wildsmith.material.presentation.rows.PresentationImageRow;
11 | import com.wildsmith.material.presentation.rows.PresentationInformationRow;
12 | import com.wildsmith.material.presentation.rows.PresentationListRow;
13 | import com.wildsmith.material.presentation.rows.PresentationNavigationRow;
14 | import com.wildsmith.material.presentation.rows.PresentationTitleRow;
15 | import com.wildsmith.material.presentation.rows.PresentationVideoRow;
16 |
17 | public class PresentationSlideFactory {
18 |
19 | private static final String TAG = PresentationSlideFactory.class.getSimpleName();
20 |
21 | public static List newSlideDeck(String[] slideClasses, String[] slideValues, int resId) {
22 | List rows = null;
23 | if (slideClasses == null || slideClasses.length == 0) {
24 | return rows;
25 | }
26 |
27 | if (slideValues == null || slideValues.length == 0) {
28 | return rows;
29 | }
30 |
31 | rows = new ArrayList(slideClasses.length);
32 |
33 | PresentationListRow row = null;
34 | try {
35 | for (int i = 0; i < slideClasses.length; i++) {
36 | Class> cls = Class.forName(slideClasses[i]);
37 | if (cls != null) {
38 | Object potential = cls.newInstance();
39 | if (potential instanceof PresentationListRow) {
40 | row = (PresentationListRow) potential;
41 | if (row instanceof PresentationActionBarRow) {
42 | row.setArguments(new Object[] {slideValues[0]});
43 | slideValues = subStringArray(slideValues, 0);
44 | } else if (row instanceof PresentationInformationRow) {
45 | row.setArguments(new Object[] {slideValues[0], slideValues[1]});
46 | slideValues = subStringArray(slideValues, 1);
47 | } else if (row instanceof PresentationNavigationRow) {
48 | row.setArguments(new Object[] {slideValues[0], slideValues[1], slideValues[2], slideValues[3]});
49 | ((PresentationNavigationRow) row).setNavigationResourceId(resId);
50 | slideValues = subStringArray(slideValues, 3);
51 | } else if (row instanceof PresentationVideoRow) {
52 | row.setArguments(new Object[] {slideValues[0]});
53 | slideValues = subStringArray(slideValues, 0);
54 | } else if (row instanceof PresentationImageRow) {
55 | row.setArguments(new Object[] {slideValues[0]});
56 | slideValues = subStringArray(slideValues, 0);
57 | } else if (row instanceof PresentationTitleRow) {
58 | row.setArguments(new Object[] {slideValues[0]});
59 | slideValues = subStringArray(slideValues, 0);
60 | }
61 | }
62 |
63 | if (row == null) {
64 | break;
65 | }
66 |
67 | rows.add(row);
68 | }
69 | }
70 | } catch (Exception e) {
71 | Log.e(TAG, "Could not create the requested slide deck." + e.getMessage());
72 | }
73 |
74 | return rows;
75 | }
76 |
77 | private static String[] subStringArray(String[] slideValues, int index) {
78 | if (slideValues == null || slideValues.length == 0) {
79 | return slideValues;
80 | }
81 |
82 | String[] newSlideValues = new String[slideValues.length];
83 | int newSlideValuesCount = 0;
84 | for (int i = 0; i < slideValues.length; i++) {
85 | if (i <= index) {
86 | continue;
87 | }
88 |
89 | newSlideValues[newSlideValuesCount] = slideValues[i];
90 | newSlideValuesCount++;
91 | }
92 |
93 | return newSlideValues;
94 | }
95 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/devtopics/ActivityTransitionActivity.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.devtopics;
2 |
3 | import android.app.FragmentManager;
4 | import android.os.Bundle;
5 |
6 | import com.wildsmith.material.presentation.PresentationActivity;
7 |
8 | public class ActivityTransitionActivity extends PresentationActivity {
9 |
10 | private ActivityTransitionFragment activityTransitionFragment;
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 |
16 | FragmentManager fm = getFragmentManager();
17 | activityTransitionFragment = (ActivityTransitionFragment) fm.findFragmentByTag(ActivityTransitionFragment.TAG);
18 |
19 | if (activityTransitionFragment == null) {
20 | activityTransitionFragment = ActivityTransitionFragment.newInstance();
21 | addFragment(activityTransitionFragment, ActivityTransitionFragment.TAG);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/devtopics/ActivityTransitionFragment.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.devtopics;
2 |
3 | import java.util.List;
4 |
5 | import com.wildsmith.material.R;
6 | import com.wildsmith.material.list.ListRow;
7 | import com.wildsmith.material.presentation.PresentationListFragment;
8 | import com.wildsmith.material.presentation.PresentationSlideFactory;
9 | import com.wildsmith.material.utils.ResourceHelper;
10 |
11 | public class ActivityTransitionFragment extends PresentationListFragment {
12 |
13 | public static final String TAG = ActivityTransitionFragment.class.getSimpleName();
14 |
15 | public ActivityTransitionFragment() {}
16 |
17 | public static ActivityTransitionFragment newInstance() {
18 | ActivityTransitionFragment fragment = new ActivityTransitionFragment();
19 | return fragment;
20 | }
21 |
22 | @Override
23 | public void setupAdapterRows() {
24 | if (mAdapter == null || mListView == null) {
25 | return;
26 | }
27 |
28 | String[] appEnvironmentClasses = ResourceHelper.getStringArray(R.array.activity_transition_classes);
29 | if (appEnvironmentClasses == null || appEnvironmentClasses.length == 0) {
30 | return;
31 | }
32 |
33 | String[] appEnvironmentInfo = ResourceHelper.getStringArray(R.array.activity_transition_values);
34 | if (appEnvironmentInfo == null || appEnvironmentInfo.length == 0) {
35 | return;
36 | }
37 |
38 | List rows =
39 | PresentationSlideFactory.newSlideDeck(appEnvironmentClasses, appEnvironmentInfo, R.array.development_concepts_classes);
40 | mAdapter.setRows(rows);
41 | }
42 |
43 | @Override
44 | public String getFragmentTag() {
45 | return TAG;
46 | }
47 |
48 | @Override
49 | public int getActionBarTitle() {
50 | return R.string.dev_activity_transition_title;
51 | }
52 |
53 | @Override
54 | public boolean isListViewScrollable() {
55 | return false;
56 | }
57 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/devtopics/CardViewActivity.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.devtopics;
2 |
3 | import android.app.FragmentManager;
4 | import android.os.Bundle;
5 |
6 | import com.wildsmith.material.presentation.PresentationActivity;
7 |
8 | public class CardViewActivity extends PresentationActivity {
9 |
10 | private CardViewFragment cardViewFragment;
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 |
16 | FragmentManager fm = getFragmentManager();
17 | cardViewFragment = (CardViewFragment) fm.findFragmentByTag(CardViewFragment.TAG);
18 |
19 | if (cardViewFragment == null) {
20 | cardViewFragment = CardViewFragment.newInstance();
21 | addFragment(cardViewFragment, CardViewFragment.TAG);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/devtopics/CardViewFragment.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.devtopics;
2 |
3 | import java.util.List;
4 |
5 | import com.wildsmith.material.R;
6 | import com.wildsmith.material.list.ListRow;
7 | import com.wildsmith.material.presentation.PresentationListFragment;
8 | import com.wildsmith.material.presentation.PresentationSlideFactory;
9 | import com.wildsmith.material.utils.ResourceHelper;
10 |
11 | public class CardViewFragment extends PresentationListFragment {
12 |
13 | public static final String TAG = CardViewFragment.class.getSimpleName();
14 |
15 | public CardViewFragment() {}
16 |
17 | public static CardViewFragment newInstance() {
18 | CardViewFragment fragment = new CardViewFragment();
19 | return fragment;
20 | }
21 |
22 | @Override
23 | public void setupAdapterRows() {
24 | if (mAdapter == null || mListView == null) {
25 | return;
26 | }
27 |
28 | String[] appEnvironmentClasses = ResourceHelper.getStringArray(R.array.card_view_classes);
29 | if (appEnvironmentClasses == null || appEnvironmentClasses.length == 0) {
30 | return;
31 | }
32 |
33 | String[] appEnvironmentInfo = ResourceHelper.getStringArray(R.array.card_view_values);
34 | if (appEnvironmentInfo == null || appEnvironmentInfo.length == 0) {
35 | return;
36 | }
37 |
38 | List rows =
39 | PresentationSlideFactory.newSlideDeck(appEnvironmentClasses, appEnvironmentInfo, R.array.development_concepts_classes);
40 | mAdapter.setRows(rows);
41 | }
42 |
43 | @Override
44 | public String getFragmentTag() {
45 | return TAG;
46 | }
47 |
48 | @Override
49 | public int getActionBarTitle() {
50 | return R.string.dev_card_view_title;
51 | }
52 |
53 | @Override
54 | public boolean isListViewScrollable() {
55 | return false;
56 | }
57 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/devtopics/ElevationActivity.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.devtopics;
2 |
3 | import android.app.FragmentManager;
4 | import android.os.Bundle;
5 |
6 | import com.wildsmith.material.presentation.PresentationActivity;
7 |
8 | public class ElevationActivity extends PresentationActivity {
9 |
10 | private ElevationFragment elevationFragment;
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 |
16 | FragmentManager fm = getFragmentManager();
17 | elevationFragment = (ElevationFragment) fm.findFragmentByTag(ElevationFragment.TAG);
18 |
19 | if (elevationFragment == null) {
20 | elevationFragment = ElevationFragment.newInstance();
21 | addFragment(elevationFragment, ElevationFragment.TAG);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/devtopics/ElevationFragment.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.devtopics;
2 |
3 | import java.util.List;
4 |
5 | import com.wildsmith.material.R;
6 | import com.wildsmith.material.list.ListRow;
7 | import com.wildsmith.material.presentation.PresentationListFragment;
8 | import com.wildsmith.material.presentation.PresentationSlideFactory;
9 | import com.wildsmith.material.utils.ResourceHelper;
10 |
11 | public class ElevationFragment extends PresentationListFragment {
12 |
13 | public static final String TAG = ElevationFragment.class.getSimpleName();
14 |
15 | public ElevationFragment() {}
16 |
17 | public static ElevationFragment newInstance() {
18 | ElevationFragment fragment = new ElevationFragment();
19 | return fragment;
20 | }
21 |
22 | @Override
23 | public void setupAdapterRows() {
24 | if (mAdapter == null || mListView == null) {
25 | return;
26 | }
27 |
28 | String[] appEnvironmentClasses = ResourceHelper.getStringArray(R.array.elevation_classes);
29 | if (appEnvironmentClasses == null || appEnvironmentClasses.length == 0) {
30 | return;
31 | }
32 |
33 | String[] appEnvironmentInfo = ResourceHelper.getStringArray(R.array.elevation_values);
34 | if (appEnvironmentInfo == null || appEnvironmentInfo.length == 0) {
35 | return;
36 | }
37 |
38 | List rows =
39 | PresentationSlideFactory.newSlideDeck(appEnvironmentClasses, appEnvironmentInfo, R.array.development_concepts_classes);
40 | mAdapter.setRows(rows);
41 | }
42 |
43 | @Override
44 | public String getFragmentTag() {
45 | return TAG;
46 | }
47 |
48 | @Override
49 | public int getActionBarTitle() {
50 | return R.string.dev_elevation_title;
51 | }
52 |
53 | @Override
54 | public boolean isListViewScrollable() {
55 | return false;
56 | }
57 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/devtopics/RippleActivity.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.devtopics;
2 |
3 | import android.app.FragmentManager;
4 | import android.os.Bundle;
5 |
6 | import com.wildsmith.material.presentation.PresentationActivity;
7 |
8 | public class RippleActivity extends PresentationActivity {
9 |
10 | private RippleFragment rippleFragment;
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 |
16 | FragmentManager fm = getFragmentManager();
17 | rippleFragment = (RippleFragment) fm.findFragmentByTag(RippleFragment.TAG);
18 |
19 | if (rippleFragment == null) {
20 | rippleFragment = RippleFragment.newInstance();
21 | addFragment(rippleFragment, RippleFragment.TAG);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/devtopics/RippleFragment.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.devtopics;
2 |
3 | import java.util.List;
4 |
5 | import com.wildsmith.material.R;
6 | import com.wildsmith.material.list.ListRow;
7 | import com.wildsmith.material.presentation.PresentationListFragment;
8 | import com.wildsmith.material.presentation.PresentationSlideFactory;
9 | import com.wildsmith.material.utils.ResourceHelper;
10 |
11 | public class RippleFragment extends PresentationListFragment {
12 |
13 | public static final String TAG = RippleFragment.class.getSimpleName();
14 |
15 | public RippleFragment() {}
16 |
17 | public static RippleFragment newInstance() {
18 | RippleFragment fragment = new RippleFragment();
19 | return fragment;
20 | }
21 |
22 | @Override
23 | public void setupAdapterRows() {
24 | if (mAdapter == null || mListView == null) {
25 | return;
26 | }
27 |
28 | String[] appEnvironmentClasses = ResourceHelper.getStringArray(R.array.ripple_classes);
29 | if (appEnvironmentClasses == null || appEnvironmentClasses.length == 0) {
30 | return;
31 | }
32 |
33 | String[] appEnvironmentInfo = ResourceHelper.getStringArray(R.array.ripple_values);
34 | if (appEnvironmentInfo == null || appEnvironmentInfo.length == 0) {
35 | return;
36 | }
37 |
38 | List rows =
39 | PresentationSlideFactory.newSlideDeck(appEnvironmentClasses, appEnvironmentInfo, R.array.development_concepts_classes);
40 | mAdapter.setRows(rows);
41 | }
42 |
43 | @Override
44 | public String getFragmentTag() {
45 | return TAG;
46 | }
47 |
48 | @Override
49 | public int getActionBarTitle() {
50 | return R.string.dev_ripple_title;
51 | }
52 |
53 | @Override
54 | public boolean isListViewScrollable() {
55 | return false;
56 | }
57 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/devtopics/ViewAnimationActivity.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.devtopics;
2 |
3 | import android.app.FragmentManager;
4 | import android.os.Bundle;
5 |
6 | import com.wildsmith.material.presentation.PresentationActivity;
7 |
8 | public class ViewAnimationActivity extends PresentationActivity {
9 |
10 | private ViewAnimationFragment viewAnimationFragment;
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 |
16 | FragmentManager fm = getFragmentManager();
17 | viewAnimationFragment = (ViewAnimationFragment) fm.findFragmentByTag(ViewAnimationFragment.TAG);
18 |
19 | if (viewAnimationFragment == null) {
20 | viewAnimationFragment = ViewAnimationFragment.newInstance();
21 | addFragment(viewAnimationFragment, ViewAnimationFragment.TAG);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/devtopics/ViewAnimationFragment.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.devtopics;
2 |
3 | import java.util.List;
4 |
5 | import com.wildsmith.material.R;
6 | import com.wildsmith.material.list.ListRow;
7 | import com.wildsmith.material.presentation.PresentationListFragment;
8 | import com.wildsmith.material.presentation.PresentationSlideFactory;
9 | import com.wildsmith.material.utils.ResourceHelper;
10 |
11 | public class ViewAnimationFragment extends PresentationListFragment {
12 |
13 | public static final String TAG = ViewAnimationFragment.class.getSimpleName();
14 |
15 | public ViewAnimationFragment() {}
16 |
17 | public static ViewAnimationFragment newInstance() {
18 | ViewAnimationFragment fragment = new ViewAnimationFragment();
19 | return fragment;
20 | }
21 |
22 | @Override
23 | public void setupAdapterRows() {
24 | if (mAdapter == null || mListView == null) {
25 | return;
26 | }
27 |
28 | String[] appEnvironmentClasses = ResourceHelper.getStringArray(R.array.view_animation_classes);
29 | if (appEnvironmentClasses == null || appEnvironmentClasses.length == 0) {
30 | return;
31 | }
32 |
33 | String[] appEnvironmentInfo = ResourceHelper.getStringArray(R.array.view_animation_values);
34 | if (appEnvironmentInfo == null || appEnvironmentInfo.length == 0) {
35 | return;
36 | }
37 |
38 | List rows =
39 | PresentationSlideFactory.newSlideDeck(appEnvironmentClasses, appEnvironmentInfo, R.array.development_concepts_classes);
40 | mAdapter.setRows(rows);
41 | }
42 |
43 | @Override
44 | public String getFragmentTag() {
45 | return TAG;
46 | }
47 |
48 | @Override
49 | public int getActionBarTitle() {
50 | return R.string.dev_view_animation_title;
51 | }
52 |
53 | @Override
54 | public boolean isListViewScrollable() {
55 | return false;
56 | }
57 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/devtopics/ViewClippingActivity.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.devtopics;
2 |
3 | import android.app.FragmentManager;
4 | import android.os.Bundle;
5 |
6 | import com.wildsmith.material.presentation.PresentationActivity;
7 |
8 | public class ViewClippingActivity extends PresentationActivity {
9 |
10 | private ViewClippingFragment viewClippingFragment;
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 |
16 | FragmentManager fm = getFragmentManager();
17 | viewClippingFragment = (ViewClippingFragment) fm.findFragmentByTag(ViewClippingFragment.TAG);
18 |
19 | if (viewClippingFragment == null) {
20 | viewClippingFragment = ViewClippingFragment.newInstance();
21 | addFragment(viewClippingFragment, ViewClippingFragment.TAG);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/devtopics/ViewClippingFragment.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.devtopics;
2 |
3 | import java.util.List;
4 |
5 | import com.wildsmith.material.R;
6 | import com.wildsmith.material.list.ListRow;
7 | import com.wildsmith.material.presentation.PresentationListFragment;
8 | import com.wildsmith.material.presentation.PresentationSlideFactory;
9 | import com.wildsmith.material.utils.ResourceHelper;
10 |
11 | public class ViewClippingFragment extends PresentationListFragment {
12 |
13 | public static final String TAG = ViewClippingFragment.class.getSimpleName();
14 |
15 | public ViewClippingFragment() {}
16 |
17 | public static ViewClippingFragment newInstance() {
18 | ViewClippingFragment fragment = new ViewClippingFragment();
19 | return fragment;
20 | }
21 |
22 | @Override
23 | public void setupAdapterRows() {
24 | if (mAdapter == null || mListView == null) {
25 | return;
26 | }
27 |
28 | String[] appEnvironmentClasses = ResourceHelper.getStringArray(R.array.view_clipping_classes);
29 | if (appEnvironmentClasses == null || appEnvironmentClasses.length == 0) {
30 | return;
31 | }
32 |
33 | String[] appEnvironmentInfo = ResourceHelper.getStringArray(R.array.view_clipping_values);
34 | if (appEnvironmentInfo == null || appEnvironmentInfo.length == 0) {
35 | return;
36 | }
37 |
38 | List rows =
39 | PresentationSlideFactory.newSlideDeck(appEnvironmentClasses, appEnvironmentInfo, R.array.development_concepts_classes);
40 | mAdapter.setRows(rows);
41 | }
42 |
43 | @Override
44 | public String getFragmentTag() {
45 | return TAG;
46 | }
47 |
48 | @Override
49 | public int getActionBarTitle() {
50 | return R.string.dev_view_clipping_title;
51 | }
52 |
53 | @Override
54 | public boolean isListViewScrollable() {
55 | return false;
56 | }
57 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/rows/PresentationActionBarRow.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.rows;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.widget.ListView;
7 | import android.widget.TextView;
8 |
9 | import com.wildsmith.material.R;
10 | import com.wildsmith.material.core.CoreMaterialActivity;
11 | import com.wildsmith.material.views.FloatingActionButton;
12 |
13 | public class PresentationActionBarRow extends PresentationListRow {
14 |
15 | private String mActionBarTitle;
16 |
17 | @Override
18 | public void setArguments(Object[] objects) {
19 | mActionBarTitle = (String) objects[0];
20 | }
21 |
22 | @Override
23 | public void setAdditionalArguments(CoreMaterialActivity activity, ListView listView, FloatingActionButton fabButton, boolean isLast) {}
24 |
25 | @Override
26 | public View getView(LayoutInflater inflater, View contentView, Context context, int position) {
27 | ViewHolder holder = null;
28 | if (contentView == null) {
29 | contentView = inflater.inflate(R.layout.presentation_action_bar_row, null);
30 | holder = createViewHolder(contentView);
31 | } else {
32 | Object contentViewHolder = contentView.getTag();
33 | if (contentViewHolder instanceof ViewHolder == false) {
34 | contentView = inflater.inflate(R.layout.presentation_action_bar_row, null);
35 | holder = createViewHolder(contentView);
36 | } else {
37 | holder = (ViewHolder) contentViewHolder;
38 | }
39 | }
40 |
41 | if (holder == null) {
42 | return contentView;
43 | }
44 |
45 | setupActionBarTitleText(holder);
46 |
47 | return contentView;
48 | }
49 |
50 | private void setupActionBarTitleText(ViewHolder holder) {
51 | if (holder.actionBarTextView == null) {
52 | return;
53 | }
54 |
55 | holder.actionBarTextView.setText(mActionBarTitle);
56 | }
57 |
58 | @Override
59 | protected ViewHolder createViewHolder(View contentView) {
60 | ViewHolder viewHolder = new ViewHolder();
61 | if (contentView == null) {
62 | return viewHolder;
63 | }
64 |
65 | viewHolder.actionBarTextView = (TextView) contentView.findViewById(R.id.presentation_action_bar_title);
66 |
67 | contentView.setTag(viewHolder);
68 |
69 | return viewHolder;
70 | }
71 |
72 | private class ViewHolder extends PresentationViewHolder {
73 |
74 | TextView actionBarTextView;
75 | }
76 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/rows/PresentationImageRow.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.rows;
2 |
3 | import android.content.Context;
4 | import android.graphics.drawable.Drawable;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.widget.ImageView;
8 |
9 | import com.wildsmith.material.R;
10 | import com.wildsmith.material.utils.ResourceHelper;
11 |
12 | public class PresentationImageRow extends PresentationListRow {
13 |
14 | private int imageResourceId;
15 |
16 | @Override
17 | public void setArguments(Object[] objects) {
18 | final String resourceName = (String) objects[0];
19 | imageResourceId = ResourceHelper.getResourceIdentifier(resourceName, "drawable");
20 | }
21 |
22 | @Override
23 | public View getView(LayoutInflater inflater, View contentView, Context context, int position) {
24 | ViewHolder holder = null;
25 | if (contentView == null) {
26 | contentView = inflater.inflate(R.layout.presentation_image_row, null);
27 | holder = createViewHolder(contentView);
28 | } else {
29 | Object contentViewHolder = contentView.getTag();
30 | if (contentViewHolder instanceof ViewHolder == false) {
31 | contentView = inflater.inflate(R.layout.presentation_image_row, null);
32 | holder = createViewHolder(contentView);
33 | } else {
34 | holder = (ViewHolder) contentViewHolder;
35 | }
36 | }
37 |
38 | if (holder == null) {
39 | return contentView;
40 | }
41 |
42 | setupImage(holder);
43 | setupSlideTopSize(position, holder);
44 | setupFABButtonPosition(holder);
45 |
46 | return contentView;
47 | }
48 |
49 | private void setupImage(ViewHolder holder) {
50 | if (holder.presentationImage == null) {
51 | return;
52 | }
53 |
54 | Drawable drawable = ResourceHelper.getDrawable(imageResourceId);
55 | holder.presentationImage.setImageDrawable(drawable);
56 | }
57 |
58 | @Override
59 | protected ViewHolder createViewHolder(View contentView) {
60 | ViewHolder viewHolder = new ViewHolder();
61 | if (contentView == null) {
62 | return viewHolder;
63 | }
64 |
65 | createPresentationViewHolder(viewHolder, contentView);
66 |
67 | viewHolder.presentationImage = (ImageView) contentView.findViewById(R.id.presentation_image);
68 |
69 | contentView.setTag(viewHolder);
70 |
71 | return viewHolder;
72 | }
73 |
74 | private class ViewHolder extends PresentationViewHolder {
75 |
76 | ImageView presentationImage;
77 | }
78 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/rows/PresentationInformationRow.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.rows;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.widget.TextView;
7 |
8 | import com.wildsmith.material.R;
9 |
10 | public class PresentationInformationRow extends PresentationListRow {
11 |
12 | private String mInformationTitle;
13 |
14 | private String mInformationMessage;
15 |
16 | @Override
17 | public void setArguments(Object[] objects) {
18 | mInformationTitle = (String) objects[0];
19 | mInformationMessage = (String) objects[1];
20 | }
21 |
22 | @Override
23 | public View getView(LayoutInflater inflater, View contentView, Context context, int position) {
24 | ViewHolder holder = null;
25 | if (contentView == null) {
26 | contentView = inflater.inflate(R.layout.presentation_information_row, null);
27 | holder = createViewHolder(contentView);
28 | } else {
29 | Object contentViewHolder = contentView.getTag();
30 | if (contentViewHolder instanceof ViewHolder == false) {
31 | contentView = inflater.inflate(R.layout.presentation_information_row, null);
32 | holder = createViewHolder(contentView);
33 | } else {
34 | holder = (ViewHolder) contentViewHolder;
35 | }
36 | }
37 |
38 | if (holder == null) {
39 | return contentView;
40 | }
41 |
42 | setupTitleText(holder);
43 | setupInformationText(holder);
44 | setupSlideTopSize(position, holder);
45 | setupFABButtonPosition(holder);
46 |
47 | return contentView;
48 | }
49 |
50 | private void setupTitleText(ViewHolder holder) {
51 | if (holder.informationTitleTextView == null) {
52 | return;
53 | }
54 |
55 | holder.informationTitleTextView.setText(mInformationTitle);
56 | }
57 |
58 | private void setupInformationText(ViewHolder holder) {
59 | if (holder.informationMessageTextView == null) {
60 | return;
61 | }
62 |
63 | holder.informationMessageTextView.setText(mInformationMessage);
64 | }
65 |
66 | @Override
67 | protected ViewHolder createViewHolder(View contentView) {
68 | ViewHolder viewHolder = new ViewHolder();
69 | if (contentView == null) {
70 | return viewHolder;
71 | }
72 |
73 | createPresentationViewHolder(viewHolder, contentView);
74 |
75 | viewHolder.informationTitleTextView = (TextView) contentView.findViewById(R.id.presentation_information_title);
76 | viewHolder.informationMessageTextView = (TextView) contentView.findViewById(R.id.presentation_information_message);
77 |
78 | contentView.setTag(viewHolder);
79 |
80 | return viewHolder;
81 | }
82 |
83 | private class ViewHolder extends PresentationViewHolder {
84 |
85 | TextView informationTitleTextView;
86 |
87 | TextView informationMessageTextView;
88 | }
89 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/rows/PresentationListRow.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.rows;
2 |
3 | import android.app.Activity;
4 | import android.content.res.Configuration;
5 | import android.view.View;
6 | import android.widget.LinearLayout.LayoutParams;
7 | import android.widget.ListView;
8 |
9 | import com.wildsmith.material.R;
10 | import com.wildsmith.material.core.CoreMaterialActivity;
11 | import com.wildsmith.material.list.ListRow;
12 | import com.wildsmith.material.utils.ResourceHelper;
13 | import com.wildsmith.material.views.FloatingActionButton;
14 |
15 | public abstract class PresentationListRow extends ListRow {
16 |
17 | protected Activity mActivity;
18 |
19 | private ListView mListView;
20 |
21 | private FloatingActionButton mFabButton;
22 |
23 | private Boolean mIsLast;
24 |
25 | public abstract void setArguments(Object[] objects);
26 |
27 | public void setAdditionalArguments(CoreMaterialActivity activity, ListView listView, FloatingActionButton fabButton, boolean isLast) {
28 | mActivity = activity;
29 | mListView = listView;
30 | mFabButton = fabButton;
31 | mIsLast = isLast;
32 | }
33 |
34 | protected abstract PresentationViewHolder createViewHolder(View contentView);
35 |
36 | protected void setupSlideTopSize(int position, PresentationViewHolder holder) {
37 | if (holder.slideTop == null || holder.divider == null) {
38 | return;
39 | }
40 |
41 | int actionBarHeight = ResourceHelper.getActionBarHeight();
42 | final int oldActionBarHeight = actionBarHeight;
43 |
44 | if (position == 2) {
45 | actionBarHeight = (actionBarHeight * 2);
46 | }
47 |
48 | final int orentation = ResourceHelper.getScreenOrientation();
49 | int height = 0;
50 | if (orentation == Configuration.ORIENTATION_PORTRAIT) {
51 | height = getHeightForPortrait(holder, actionBarHeight, oldActionBarHeight);
52 | } else {
53 | height = getHeightForLandscape(holder, actionBarHeight, oldActionBarHeight);
54 | }
55 |
56 | LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, height);
57 | holder.slideTop.setLayoutParams(layoutParams);
58 | }
59 |
60 | private int getHeightForPortrait(PresentationViewHolder holder, int actionBarHeight, final int oldActionBarHeight) {
61 | int height = 0;
62 | if (mIsLast == false) {
63 | height = mListView.getHeight() - actionBarHeight - oldActionBarHeight;
64 | holder.divider.setVisibility(View.VISIBLE);
65 | } else {
66 | height = mListView.getHeight() - (actionBarHeight * 2) - oldActionBarHeight;
67 | holder.divider.setVisibility(View.GONE);
68 | }
69 |
70 | return height;
71 | }
72 |
73 | private int getHeightForLandscape(PresentationViewHolder holder, int actionBarHeight, final int oldActionBarHeight) {
74 | int height = 0;
75 | if (mIsLast == false) {
76 | height = mListView.getWidth() - actionBarHeight - oldActionBarHeight;
77 | holder.divider.setVisibility(View.VISIBLE);
78 | } else {
79 | height = mListView.getWidth() - (actionBarHeight * 2) - oldActionBarHeight;
80 | holder.divider.setVisibility(View.GONE);
81 | }
82 |
83 | return height;
84 | }
85 |
86 | protected void setupFABButtonPosition(PresentationViewHolder holder) {
87 | if (mFabButton == null || mFabButton.isAttached() || holder.fabGrip == null) {
88 | return;
89 | }
90 |
91 | mFabButton.setY(holder.slideTop.getLayoutParams().height + (ResourceHelper.getActionBarHeight() * 2)
92 | - ResourceHelper.getDimension(R.dimen.half_fab_size));
93 | mFabButton.setAttached(true);
94 | }
95 |
96 | protected void createPresentationViewHolder(PresentationViewHolder viewHolder, View contentView) {
97 | if (contentView == null) {
98 | return;
99 | }
100 |
101 | viewHolder.fabGrip = contentView.findViewById(R.id.presentation_fab_grip);
102 | viewHolder.slideTop = contentView.findViewById(R.id.presentation_slide_top);
103 | viewHolder.divider = contentView.findViewById(R.id.presentation_divider);
104 | }
105 |
106 | protected class PresentationViewHolder {
107 |
108 | private View fabGrip;
109 |
110 | private View slideTop;
111 |
112 | private View divider;
113 | }
114 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/rows/PresentationTitleRow.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.rows;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.widget.TextView;
7 |
8 | import com.wildsmith.material.R;
9 |
10 | public class PresentationTitleRow extends PresentationListRow {
11 |
12 | private String mTitle;
13 |
14 | @Override
15 | public void setArguments(Object[] objects) {
16 | mTitle = (String) objects[0];
17 | }
18 |
19 | @Override
20 | public View getView(LayoutInflater inflater, View contentView, Context context, int position) {
21 | ViewHolder holder = null;
22 | if (contentView == null) {
23 | contentView = inflater.inflate(R.layout.presentation_title_row, null);
24 | holder = createViewHolder(contentView);
25 | } else {
26 | Object contentViewHolder = contentView.getTag();
27 | if (contentViewHolder instanceof ViewHolder == false) {
28 | contentView = inflater.inflate(R.layout.presentation_title_row, null);
29 | holder = createViewHolder(contentView);
30 | } else {
31 | holder = (ViewHolder) contentViewHolder;
32 | }
33 | }
34 |
35 | if (holder == null) {
36 | return contentView;
37 | }
38 |
39 | setupTitleText(holder);
40 | setupSlideTopSize(position, holder);
41 | setupFABButtonPosition(holder);
42 |
43 | return contentView;
44 | }
45 |
46 | private void setupTitleText(ViewHolder holder) {
47 | if (holder.titleTextView == null) {
48 | return;
49 | }
50 |
51 | holder.titleTextView.setText(mTitle);
52 | }
53 |
54 | @Override
55 | protected ViewHolder createViewHolder(View contentView) {
56 | ViewHolder viewHolder = new ViewHolder();
57 | if (contentView == null) {
58 | return viewHolder;
59 | }
60 |
61 | createPresentationViewHolder(viewHolder, contentView);
62 |
63 | viewHolder.titleTextView = (TextView) contentView.findViewById(R.id.presentation_title);
64 |
65 | contentView.setTag(viewHolder);
66 |
67 | return viewHolder;
68 | }
69 |
70 | private class ViewHolder extends PresentationViewHolder {
71 |
72 | TextView titleTextView;
73 | }
74 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/rows/PresentationVideoRow.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.rows;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.widget.LinearLayout;
7 |
8 | import com.wildsmith.material.R;
9 | import com.wildsmith.material.views.VideoViewRecycler;
10 | import com.wildsmith.material.views.VideoViewRecycler.VideoViewRecyclerListener;
11 |
12 | public class PresentationVideoRow extends PresentationListRow implements VideoViewRecyclerListener {
13 |
14 | private String mResourceName;
15 |
16 | private VideoViewRecycler mVideoView;
17 |
18 | private LinearLayout mVideoViewLoading;
19 |
20 | @Override
21 | public void setArguments(Object[] objects) {
22 | mResourceName = (String) objects[0];
23 | }
24 |
25 | @Override
26 | public View getView(LayoutInflater inflater, View contentView, Context context, int position) {
27 | ViewHolder holder = null;
28 | if (contentView == null) {
29 | contentView = inflater.inflate(R.layout.presentation_video_row, null);
30 | holder = createViewHolder(contentView);
31 | } else {
32 | Object contentViewHolder = contentView.getTag();
33 | if (contentViewHolder instanceof ViewHolder == false) {
34 | contentView = inflater.inflate(R.layout.presentation_video_row, null);
35 | holder = createViewHolder(contentView);
36 | } else {
37 | holder = (ViewHolder) contentViewHolder;
38 | }
39 | }
40 |
41 | if (holder == null) {
42 | return contentView;
43 | }
44 |
45 | mVideoView = holder.videoView;
46 | mVideoViewLoading = holder.videoViewLoading;
47 |
48 | setupVideoView(holder);
49 | setupVideoProgressBar(holder);
50 | setupSlideTopSize(position, holder);
51 | setupFABButtonPosition(holder);
52 |
53 | return contentView;
54 | }
55 |
56 | private void setupVideoView(ViewHolder holder) {
57 | if (holder.videoView == null) {
58 | return;
59 | }
60 |
61 | holder.videoView.setBackgroundResource(R.color.background_color);
62 | holder.videoView.setVideoViewRecyclerListener(this);
63 | }
64 |
65 | private void setupVideoProgressBar(ViewHolder holder) {
66 | if (holder.videoViewLoading == null) {
67 | return;
68 | }
69 |
70 | holder.videoViewLoading.setVisibility(View.VISIBLE);
71 | }
72 |
73 | public void startVideoView() {
74 | if (mVideoView == null) {
75 | return;
76 | }
77 |
78 | mVideoView.setupAttributes(mResourceName);
79 | mVideoView.startCurrentPlayback();
80 | }
81 |
82 | @Override
83 | protected ViewHolder createViewHolder(View contentView) {
84 | ViewHolder viewHolder = new ViewHolder();
85 | if (contentView == null) {
86 | return viewHolder;
87 | }
88 |
89 | createPresentationViewHolder(viewHolder, contentView);
90 |
91 | viewHolder.videoView = (VideoViewRecycler) contentView.findViewById(R.id.presentation_video_view);
92 | viewHolder.videoViewLoading = (LinearLayout) contentView.findViewById(R.id.presentation_video_view_loading);
93 |
94 | contentView.setTag(viewHolder);
95 |
96 | return viewHolder;
97 | }
98 |
99 | protected class ViewHolder extends PresentationViewHolder {
100 |
101 | VideoViewRecycler videoView;
102 |
103 | LinearLayout videoViewLoading;
104 | }
105 |
106 | @SuppressWarnings("deprecation")
107 | @Override
108 | public void onVideoPlay() {
109 | if (mVideoView == null) {
110 | return;
111 | }
112 |
113 | mVideoViewLoading.setVisibility(View.GONE);
114 | mVideoView.setBackgroundDrawable(null);
115 | }
116 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/uitopics/AppEnvironmentActivity.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.uitopics;
2 |
3 | import android.app.FragmentManager;
4 | import android.os.Bundle;
5 |
6 | import com.wildsmith.material.presentation.PresentationActivity;
7 |
8 | public class AppEnvironmentActivity extends PresentationActivity {
9 |
10 | private AppEnvironmentFragment appEnvironmentFragment;
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 |
16 | FragmentManager fm = getFragmentManager();
17 | appEnvironmentFragment = (AppEnvironmentFragment) fm.findFragmentByTag(AppEnvironmentFragment.TAG);
18 |
19 | if (appEnvironmentFragment == null) {
20 | appEnvironmentFragment = AppEnvironmentFragment.newInstance();
21 | addFragment(appEnvironmentFragment, AppEnvironmentFragment.TAG);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/uitopics/AppEnvironmentFragment.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.uitopics;
2 |
3 | import java.util.List;
4 |
5 | import com.wildsmith.material.R;
6 | import com.wildsmith.material.list.ListRow;
7 | import com.wildsmith.material.presentation.PresentationListFragment;
8 | import com.wildsmith.material.presentation.PresentationSlideFactory;
9 | import com.wildsmith.material.utils.ResourceHelper;
10 |
11 | public class AppEnvironmentFragment extends PresentationListFragment {
12 |
13 | public static final String TAG = AppEnvironmentFragment.class.getSimpleName();
14 |
15 | public AppEnvironmentFragment() {}
16 |
17 | public static AppEnvironmentFragment newInstance() {
18 | AppEnvironmentFragment fragment = new AppEnvironmentFragment();
19 | return fragment;
20 | }
21 |
22 | @Override
23 | public void setupAdapterRows() {
24 | if (mAdapter == null || mListView == null) {
25 | return;
26 | }
27 |
28 | String[] appEnvironmentClasses = ResourceHelper.getStringArray(R.array.app_environment_classes);
29 | if (appEnvironmentClasses == null || appEnvironmentClasses.length == 0) {
30 | return;
31 | }
32 |
33 | String[] appEnvironmentInfo = ResourceHelper.getStringArray(R.array.app_environment_values);
34 | if (appEnvironmentInfo == null || appEnvironmentInfo.length == 0) {
35 | return;
36 | }
37 |
38 | List rows = PresentationSlideFactory.newSlideDeck(appEnvironmentClasses, appEnvironmentInfo, R.array.principles_classes);
39 | mAdapter.setRows(rows);
40 | }
41 |
42 | @Override
43 | public String getFragmentTag() {
44 | return TAG;
45 | }
46 |
47 | @Override
48 | public int getActionBarTitle() {
49 | return R.string.presentation_app_environment_title;
50 | }
51 |
52 | @Override
53 | public boolean isListViewScrollable() {
54 | return false;
55 | }
56 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/uitopics/MeaningfulMotionActivity.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.uitopics;
2 |
3 | import android.app.FragmentManager;
4 | import android.os.Bundle;
5 |
6 | import com.wildsmith.material.presentation.PresentationActivity;
7 |
8 | public class MeaningfulMotionActivity extends PresentationActivity {
9 |
10 | private MeaningfulMotionFragment meaningfulMotionFragment;
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 |
16 | FragmentManager fm = getFragmentManager();
17 | meaningfulMotionFragment = (MeaningfulMotionFragment) fm.findFragmentByTag(MeaningfulMotionFragment.TAG);
18 |
19 | if (meaningfulMotionFragment == null) {
20 | meaningfulMotionFragment = MeaningfulMotionFragment.newInstance();
21 | addFragment(meaningfulMotionFragment, MeaningfulMotionFragment.TAG);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/uitopics/MeaningfulMotionFragment.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.uitopics;
2 |
3 | import java.util.List;
4 |
5 | import com.wildsmith.material.R;
6 | import com.wildsmith.material.list.ListRow;
7 | import com.wildsmith.material.presentation.PresentationListFragment;
8 | import com.wildsmith.material.presentation.PresentationSlideFactory;
9 | import com.wildsmith.material.utils.ResourceHelper;
10 |
11 | public class MeaningfulMotionFragment extends PresentationListFragment {
12 |
13 | public static final String TAG = AppEnvironmentFragment.class.getSimpleName();
14 |
15 | public MeaningfulMotionFragment() {}
16 |
17 | public static MeaningfulMotionFragment newInstance() {
18 | MeaningfulMotionFragment fragment = new MeaningfulMotionFragment();
19 | return fragment;
20 | }
21 |
22 | @Override
23 | public void setupAdapterRows() {
24 | if (mAdapter == null || mListView == null) {
25 | return;
26 | }
27 |
28 | String[] meaningfulMotionClasses = ResourceHelper.getStringArray(R.array.meaningful_motion_classes);
29 | if (meaningfulMotionClasses == null || meaningfulMotionClasses.length == 0) {
30 | return;
31 | }
32 |
33 | String[] meaningfulMotionValues = ResourceHelper.getStringArray(R.array.meaningful_motion_values);
34 | if (meaningfulMotionValues == null || meaningfulMotionValues.length == 0) {
35 | return;
36 | }
37 |
38 | List rows =
39 | PresentationSlideFactory.newSlideDeck(meaningfulMotionClasses, meaningfulMotionValues, R.array.principles_classes);
40 | mAdapter.setRows(rows);
41 | }
42 |
43 | @Override
44 | public String getFragmentTag() {
45 | return TAG;
46 | }
47 |
48 | @Override
49 | public int getActionBarTitle() {
50 | return R.string.presentation_meaningful_motion_title;
51 | }
52 |
53 | @Override
54 | public boolean isListViewScrollable() {
55 | return false;
56 | }
57 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/uitopics/OneAdaptiveDesignActivity.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.uitopics;
2 |
3 | import android.app.FragmentManager;
4 | import android.os.Bundle;
5 |
6 | import com.wildsmith.material.presentation.PresentationActivity;
7 |
8 | public class OneAdaptiveDesignActivity extends PresentationActivity {
9 |
10 | private OneAdaptiveDesignFragment oneAdaptiveDesignFragment;
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 |
16 | FragmentManager fm = getFragmentManager();
17 | oneAdaptiveDesignFragment = (OneAdaptiveDesignFragment) fm.findFragmentByTag(OneAdaptiveDesignFragment.TAG);
18 |
19 | if (oneAdaptiveDesignFragment == null) {
20 | oneAdaptiveDesignFragment = OneAdaptiveDesignFragment.newInstance();
21 | addFragment(oneAdaptiveDesignFragment, OneAdaptiveDesignFragment.TAG);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/uitopics/OneAdaptiveDesignFragment.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.uitopics;
2 |
3 | import java.util.List;
4 |
5 | import com.wildsmith.material.R;
6 | import com.wildsmith.material.list.ListRow;
7 | import com.wildsmith.material.presentation.PresentationListFragment;
8 | import com.wildsmith.material.presentation.PresentationSlideFactory;
9 | import com.wildsmith.material.utils.ResourceHelper;
10 |
11 | public class OneAdaptiveDesignFragment extends PresentationListFragment {
12 |
13 | public static final String TAG = OneAdaptiveDesignFragment.class.getSimpleName();
14 |
15 | public OneAdaptiveDesignFragment() {}
16 |
17 | public static OneAdaptiveDesignFragment newInstance() {
18 | OneAdaptiveDesignFragment fragment = new OneAdaptiveDesignFragment();
19 | return fragment;
20 | }
21 |
22 | @Override
23 | public void setupAdapterRows() {
24 | if (mAdapter == null || mListView == null) {
25 | return;
26 | }
27 |
28 | String[] appEnvironmentClasses = ResourceHelper.getStringArray(R.array.one_adaptive_design_classes);
29 | if (appEnvironmentClasses == null || appEnvironmentClasses.length == 0) {
30 | return;
31 | }
32 |
33 | String[] appEnvironmentInfo = ResourceHelper.getStringArray(R.array.one_adaptive_design_values);
34 | if (appEnvironmentInfo == null || appEnvironmentInfo.length == 0) {
35 | return;
36 | }
37 |
38 | List rows = PresentationSlideFactory.newSlideDeck(appEnvironmentClasses, appEnvironmentInfo, R.array.principles_classes);
39 | mAdapter.setRows(rows);
40 | }
41 |
42 | @Override
43 | public String getFragmentTag() {
44 | return TAG;
45 | }
46 |
47 | @Override
48 | public int getActionBarTitle() {
49 | return R.string.presentation_one_adaptive_design_title;
50 | }
51 |
52 | @Override
53 | public boolean isListViewScrollable() {
54 | return false;
55 | }
56 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/uitopics/PaperAndInkActivity.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.uitopics;
2 |
3 | import android.app.FragmentManager;
4 | import android.os.Bundle;
5 |
6 | import com.wildsmith.material.presentation.PresentationActivity;
7 |
8 | public class PaperAndInkActivity extends PresentationActivity {
9 |
10 | private PaperAndInkFragment paperAndInkFragment;
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 |
16 | FragmentManager fm = getFragmentManager();
17 | paperAndInkFragment = (PaperAndInkFragment) fm.findFragmentByTag(PaperAndInkFragment.TAG);
18 |
19 | if (paperAndInkFragment == null) {
20 | paperAndInkFragment = PaperAndInkFragment.newInstance();
21 | addFragment(paperAndInkFragment, PaperAndInkFragment.TAG);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/uitopics/PaperAndInkFragment.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.uitopics;
2 |
3 | import java.util.List;
4 |
5 | import com.wildsmith.material.R;
6 | import com.wildsmith.material.list.ListRow;
7 | import com.wildsmith.material.presentation.PresentationListFragment;
8 | import com.wildsmith.material.presentation.PresentationSlideFactory;
9 | import com.wildsmith.material.utils.ResourceHelper;
10 |
11 | public class PaperAndInkFragment extends PresentationListFragment {
12 |
13 | public static final String TAG = AppEnvironmentFragment.class.getSimpleName();
14 |
15 | public PaperAndInkFragment() {}
16 |
17 | public static PaperAndInkFragment newInstance() {
18 | PaperAndInkFragment fragment = new PaperAndInkFragment();
19 | return fragment;
20 | }
21 |
22 | @Override
23 | public void setupAdapterRows() {
24 | if (mAdapter == null || mListView == null) {
25 | return;
26 | }
27 |
28 | String[] paperAndInkClasses = ResourceHelper.getStringArray(R.array.paper_and_ink_classes);
29 | if (paperAndInkClasses == null || paperAndInkClasses.length == 0) {
30 | return;
31 | }
32 |
33 | String[] paperAndInkValues = ResourceHelper.getStringArray(R.array.paper_and_ink_values);
34 | if (paperAndInkValues == null || paperAndInkValues.length == 0) {
35 | return;
36 | }
37 |
38 | List rows = PresentationSlideFactory.newSlideDeck(paperAndInkClasses, paperAndInkValues, R.array.principles_classes);
39 | mAdapter.setRows(rows);
40 | }
41 |
42 | @Override
43 | public String getFragmentTag() {
44 | return TAG;
45 | }
46 |
47 | @Override
48 | public int getActionBarTitle() {
49 | return R.string.presentation_paper_and_ink_title;
50 | }
51 |
52 | @Override
53 | public boolean isListViewScrollable() {
54 | return false;
55 | }
56 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/uitopics/VisualDesignActivity.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.uitopics;
2 |
3 | import android.app.FragmentManager;
4 | import android.os.Bundle;
5 |
6 | import com.wildsmith.material.presentation.PresentationActivity;
7 |
8 | public class VisualDesignActivity extends PresentationActivity {
9 |
10 | private VisualDesignFragment visualDesignFragment;
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 |
16 | FragmentManager fm = getFragmentManager();
17 | visualDesignFragment = (VisualDesignFragment) fm.findFragmentByTag(VisualDesignFragment.TAG);
18 |
19 | if (visualDesignFragment == null) {
20 | visualDesignFragment = VisualDesignFragment.newInstance();
21 | addFragment(visualDesignFragment, VisualDesignFragment.TAG);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/uitopics/VisualDesignFragment.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.uitopics;
2 |
3 | import java.util.List;
4 |
5 | import com.wildsmith.material.R;
6 | import com.wildsmith.material.list.ListRow;
7 | import com.wildsmith.material.presentation.PresentationListFragment;
8 | import com.wildsmith.material.presentation.PresentationSlideFactory;
9 | import com.wildsmith.material.utils.ResourceHelper;
10 |
11 | public class VisualDesignFragment extends PresentationListFragment {
12 |
13 | public static final String TAG = VisualDesignFragment.class.getSimpleName();
14 |
15 | public VisualDesignFragment() {}
16 |
17 | public static VisualDesignFragment newInstance() {
18 | VisualDesignFragment fragment = new VisualDesignFragment();
19 | return fragment;
20 | }
21 |
22 | @Override
23 | public void setupAdapterRows() {
24 | if (mAdapter == null || mListView == null) {
25 | return;
26 | }
27 |
28 | String[] appEnvironmentClasses = ResourceHelper.getStringArray(R.array.visual_design_classes);
29 | if (appEnvironmentClasses == null || appEnvironmentClasses.length == 0) {
30 | return;
31 | }
32 |
33 | String[] appEnvironmentInfo = ResourceHelper.getStringArray(R.array.visual_design_values);
34 | if (appEnvironmentInfo == null || appEnvironmentInfo.length == 0) {
35 | return;
36 | }
37 |
38 | List rows = PresentationSlideFactory.newSlideDeck(appEnvironmentClasses, appEnvironmentInfo, R.array.principles_classes);
39 | mAdapter.setRows(rows);
40 | }
41 |
42 | @Override
43 | public String getFragmentTag() {
44 | return TAG;
45 | }
46 |
47 | @Override
48 | public int getActionBarTitle() {
49 | return R.string.presentation_visual_design_title;
50 | }
51 |
52 | @Override
53 | public boolean isListViewScrollable() {
54 | return false;
55 | }
56 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/uitopics/WhatIsMaterialActivity.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.uitopics;
2 |
3 | import android.app.FragmentManager;
4 | import android.os.Bundle;
5 |
6 | import com.wildsmith.material.presentation.PresentationActivity;
7 |
8 | public class WhatIsMaterialActivity extends PresentationActivity {
9 |
10 | private WhatIsMaterialFragment whatIsMaterialFragment;
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 |
16 | FragmentManager fm = getFragmentManager();
17 | whatIsMaterialFragment = (WhatIsMaterialFragment) fm.findFragmentByTag(WhatIsMaterialFragment.TAG);
18 |
19 | if (whatIsMaterialFragment == null) {
20 | whatIsMaterialFragment = WhatIsMaterialFragment.newInstance();
21 | addFragment(whatIsMaterialFragment, WhatIsMaterialFragment.TAG);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/presentation/uitopics/WhatIsMaterialFragment.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.presentation.uitopics;
2 |
3 | import java.util.List;
4 |
5 | import com.wildsmith.material.R;
6 | import com.wildsmith.material.list.ListRow;
7 | import com.wildsmith.material.playground.PlaygroundFragment;
8 | import com.wildsmith.material.presentation.PresentationListFragment;
9 | import com.wildsmith.material.presentation.PresentationSlideFactory;
10 | import com.wildsmith.material.utils.ResourceHelper;
11 |
12 | public class WhatIsMaterialFragment extends PresentationListFragment {
13 |
14 | public static final String TAG = PlaygroundFragment.class.getSimpleName();
15 |
16 | public WhatIsMaterialFragment() {}
17 |
18 | public static WhatIsMaterialFragment newInstance() {
19 | WhatIsMaterialFragment fragment = new WhatIsMaterialFragment();
20 | return fragment;
21 | }
22 |
23 | @Override
24 | public void setupAdapterRows() {
25 | if (mAdapter == null || mListView == null) {
26 | return;
27 | }
28 |
29 | String[] materialClasses = ResourceHelper.getStringArray(R.array.what_is_material_classes);
30 | if (materialClasses == null || materialClasses.length == 0) {
31 | return;
32 | }
33 |
34 | String[] materialInfo = ResourceHelper.getStringArray(R.array.what_is_material_values);
35 | if (materialInfo == null || materialInfo.length == 0) {
36 | return;
37 | }
38 |
39 | List rows = PresentationSlideFactory.newSlideDeck(materialClasses, materialInfo, R.array.principles_classes);
40 | mAdapter.setRows(rows);
41 | }
42 |
43 | @Override
44 | public String getFragmentTag() {
45 | return TAG;
46 | }
47 |
48 | @Override
49 | public int getActionBarTitle() {
50 | return R.string.presentation_what_is_material_title;
51 | }
52 |
53 | @Override
54 | public boolean isListViewScrollable() {
55 | return false;
56 | }
57 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/utils/StringUtils.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.utils;
2 |
3 | public class StringUtils {
4 |
5 | public static boolean isEmpty(String string) {
6 | if (string == null || "".equals(string)) {
7 | return true;
8 | }
9 |
10 | return false;
11 | }
12 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/views/FloatingActionButton.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.views;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.content.Context;
5 | import android.graphics.Bitmap;
6 | import android.graphics.Canvas;
7 | import android.graphics.Paint;
8 | import android.graphics.Point;
9 | import android.graphics.drawable.BitmapDrawable;
10 | import android.graphics.drawable.Drawable;
11 | import android.util.AttributeSet;
12 | import android.view.Display;
13 | import android.view.WindowManager;
14 | import android.view.animation.AccelerateDecelerateInterpolator;
15 | import android.view.animation.Interpolator;
16 | import android.widget.ImageButton;
17 |
18 | public class FloatingActionButton extends ImageButton {
19 |
20 | private Interpolator mInterpolator;
21 |
22 | private Bitmap mBitmap;
23 |
24 | private Paint mDrawablePaint;
25 |
26 | private float currentY;
27 |
28 | private boolean mHidden;
29 |
30 | private boolean isAttached;
31 |
32 | private int mScreenHeight;
33 |
34 | public FloatingActionButton(Context context, AttributeSet attributeSet) {
35 | super(context, attributeSet);
36 |
37 | mInterpolator = new AccelerateDecelerateInterpolator();
38 |
39 | mScreenHeight = getScreenHeight(context);
40 |
41 | // final float elevationPx = ViewHelper.getPxFromDP(getResources(), 1);
42 | // setElevation(elevationPx);
43 |
44 | // final int size = (int) ResourceHelper.getDimensionPixelSize(R.dimen.fab_size);
45 | // Outline outline = new Outline();
46 | // outline.setOval(0, 0, size - (int) elevationPx, size - (int) elevationPx);
47 | // setOutline(outline);
48 | // setClipToOutline(true);
49 |
50 | setScaleType(ScaleType.FIT_CENTER);
51 | // setStateListAnimator(AnimatorInflater.loadStateListAnimator(context,
52 | // R.drawable.fab_button_states));
53 | }
54 |
55 | @Override
56 | protected void onDraw(Canvas canvas) {
57 | if (mBitmap == null) {
58 | mBitmap = ((BitmapDrawable) getDrawable()).getBitmap();
59 | }
60 |
61 | if (mBitmap == null) {
62 | return;
63 | }
64 |
65 | canvas.drawBitmap(mBitmap, (getWidth() - mBitmap.getWidth()) / 2, (getHeight() - mBitmap.getHeight()) / 2, mDrawablePaint);
66 | }
67 |
68 | @Override
69 | public void setImageDrawable(Drawable drawable) {
70 | mBitmap = ((BitmapDrawable) drawable).getBitmap();
71 | }
72 |
73 | public void setImageDrawableColor(int color) {
74 | if (mDrawablePaint == null) {
75 | mDrawablePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
76 | }
77 |
78 | mDrawablePaint.setColor(color);
79 | }
80 |
81 | private int getScreenHeight(Context context) {
82 | WindowManager mWindowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
83 | Display display = mWindowManager.getDefaultDisplay();
84 | Point size = new Point();
85 | display.getSize(size);
86 | return size.y;
87 | }
88 |
89 | public void hide() {
90 | if (mHidden) {
91 | return;
92 | }
93 |
94 | currentY = getY();
95 |
96 | ObjectAnimator animator = ObjectAnimator.ofFloat(this, "Y", mScreenHeight);
97 | animator.setInterpolator(mInterpolator);
98 | animator.start();
99 |
100 | mHidden = true;
101 | }
102 |
103 | public void show() {
104 | if (mHidden == false) {
105 | return;
106 | }
107 |
108 | ObjectAnimator animator = ObjectAnimator.ofFloat(this, "Y", currentY);
109 | animator.setInterpolator(mInterpolator);
110 | animator.start();
111 |
112 | mHidden = false;
113 | }
114 |
115 | public boolean isAttached() {
116 | return isAttached;
117 | }
118 |
119 | public void setAttached(boolean isAttached) {
120 | this.isAttached = isAttached;
121 | }
122 | }
--------------------------------------------------------------------------------
/src/com/wildsmith/material/views/ViewHelper.java:
--------------------------------------------------------------------------------
1 | package com.wildsmith.material.views;
2 |
3 | import android.content.res.Resources;
4 | import android.graphics.PorterDuff.Mode;
5 | import android.graphics.drawable.Drawable;
6 | import android.util.TypedValue;
7 |
8 | import com.wildsmith.material.utils.ResourceHelper;
9 |
10 | public class ViewHelper {
11 |
12 | public static float getPxFromDP(Resources resources, int dp) {
13 | return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, resources.getDisplayMetrics());
14 | }
15 |
16 | public static Drawable changeDrawableColor(int resourceId, int newImageColor) {
17 | Drawable drawable = ResourceHelper.getDrawable(resourceId);
18 | drawable.setColorFilter(newImageColor, Mode.MULTIPLY);
19 | return drawable;
20 | }
21 | }
--------------------------------------------------------------------------------