[] Explorations around Android custom layouts

Overview

android-layout-samples

Explorations around Android custom layouts, including off main thread View measure/layout passes.

Sample code for:

  • Composite View
  • Custom Composite View
  • Flat Custom View
  • Async Custom View

For more information, read: http://lucasr.org/?p=3920

License

Copyright 2014 Lucas Rocha

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
A sample Android app which showcases advanced usage of Dagger among other open source libraries.
A sample Android app which showcases advanced usage of Dagger among other open source libraries.

U+2020 A sample Android app which showcases advanced usage of Dagger among other open source libraries. Watch the corresponding talk or view the slide

Proguard configurations for common Android libraries

android-proguard-snippets Example Proguard configurations for common Android libraries. This project assumes that your ProGuard configuration is based

Examples of Android applications

Android Demos This is a collection of basic android examples created by Novoda. CarouselFragment CompassExample ContactSelector CustomActivityTransiti

A simple chat demo for socket.io and Android

socket.io-android-chat This is a simple chat demo for socket.io and Android. You can connect to https://socket-io-chat.now.sh using this app. Installa

Google Play game services - Android samples

Google Play game services - Android Samples Copyright (C) 2014 Google Inc. Contents These are the Android samples for Google Play game services. Colle

Android common lib demo, include ImageCache, HttpCache, DropDownListView, DownloadManager, install apk silent and so on, you can find description
Android common lib demo, include ImageCache, HttpCache, DropDownListView, DownloadManager, install apk silent and so on, you can find description

android-demo 关于我,欢迎关注 微博:Trinea 主页:trinea.cn 邮箱:trinea.cn#gmail.com 微信:codek2 依赖:trinea-android-common android-auto-scroll-view-pager viewpager-indica

Cheat Sheet for Android Interviews
Cheat Sheet for Android Interviews

Android-Cheat-sheet Cheat Sheet for Android Interviews Topics Common Coding Programs Data Structure Coding Programs Android Interview Questions Java I

RxJava architecture library for Android
RxJava architecture library for Android

Reference Architecture for Android using RxJava This is an ambitious reference project of what can be done with RxJava to create an app based on strea

📚  Sample Android Components Architecture on a modular word focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack.
📚 Sample Android Components Architecture on a modular word focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack.

Android Components Architecture in a Modular Word Android Components Architecture in a Modular Word is a sample project that presents modern, 2020 app

Comments
  • Update target sdk, build tools, replace removed method FloatMath.ceil…

    Update target sdk, build tools, replace removed method FloatMath.ceil…

    Hello!

    I run into your post and found it interesting. It needs some updating to be started in modern Android Studio, so I updated it to look at sample.

    Probably, this request can save 5 minutes of all next people who wants to check this project.

    Thank you for sharing!

    opened by Gaket 0
  • Potential Mistake ?

    Potential Mistake ?

    Hey lucas,

    First off, thank you for this repo. this is an challenging, but worthwhile endeavor. I was going through TweetElement.java , when I caught something odd with getMeasuredHeightWithMargins(UIElement uiElement) and getHeightWithMargins(UIElement) . For ease, I have attached the methods below:

     private int getHeightWithMargins(UIElement element) {
            final MarginLayoutParams lp = (MarginLayoutParams) element.getLayoutParams();
            return element.getMeasuredHeight() + lp.topMargin + lp.bottomMargin;
        } 
       private int getMeasuredHeightWithMargins(UIElement element) {
            final MarginLayoutParams lp = (MarginLayoutParams) element.getLayoutParams();
            return element.getMeasuredHeight() + lp.topMargin + lp.bottomMargin;
        }
    

    As you can tell, there is no different between the two. I'm still learning, so I might be wrong, but do you mean to call element.getHeight() in the first method? If so let me know, I'd be happy to submit a PR.

    opened by yrizk 2
  • Can't import project, please help

    Can't import project, please help

    It says : Error:Android Source Generator: [android-layout-samples] AndroidManifest.xml file not found

    But it doesn't make sense: I can see the manifest file... Why does it happen?

    I've tried to uninstall Android-Studio and put the Canary build, and now I get this instead (when trying to import from Git) : "The project is using an unsupported version of the Android Gradle plug-in (0.9.2). The recommended version is 0.14.2."

    opened by AndroidDeveloperLB 0
Owner
Lucas Rocha
Mobile UI platform at Facebook. Formerly at Mozilla, GNOME, litl, and Nokia.
Lucas Rocha
A project which demonstrate how to develop a custom client on android for dribbble.com

##What is this? This is a project with custom client app on android for https://dribbble.com, which you can browse the popular icon and animation, lik

ZhangLei 599 Nov 14, 2022
This repo is to document my learning about Custom views in android

Custom-Views This repo is to document my learning about Custom views in android Note: If you are trying to understand Custom views, go in order: Custo

Kshitij Kumar 7 Feb 24, 2022
Quality-Tools-for-Android 7.5 0.0 L5 Java This is an Android sample app + tests that will be used to work on various project to increase the quality of the Android platform.

Quality Tools for Android This is an Android sample app + tests that will be used to work on various project to increase the quality of the Android pl

Stéphane Nicolas 1.3k Dec 27, 2022
A simple app to showcase Androids Material Design and some of the cool new cool stuff in Android Lollipop. RecyclerView, CardView, ActionBarDrawerToggle, DrawerLayout, Animations, Android Compat Design, Toolbar

#Android-LollipopShowcase This is a simple showcase to show off Android's all new Material Design and some other cool new stuff which is (new) in Andr

Mike Penz 1.8k Nov 10, 2022
A simple app to showcase Androids Material Design and some of the cool new cool stuff in Android Lollipop. RecyclerView, CardView, ActionBarDrawerToggle, DrawerLayout, Animations, Android Compat Design, Toolbar

#Android-LollipopShowcase This is a simple showcase to show off Android's all new Material Design and some other cool new stuff which is (new) in Andr

Mike Penz 1.8k Nov 10, 2022
simple android grocery app using kotlin and android studio

Project Idea The idea of this project is to make a grocery android app that users can use to order the groceries they want. It doesn't contain any bac

null 0 Nov 29, 2021
Beetlebug is an open source insecure Android application with CTF challenges built for Android Penetration Testers and Bug Bounty hunters.

Beetlebug Beetlebug is a beginner-friendly Capture the Flag Android application that aims to inspire interest in Mobile Application Security. It is ge

Hafiz Abdulaziz 60 Oct 11, 2022
Do's and Don'ts for Android development, by Futurice developers

Best practices in Android development Avoid reinventing the wheel by following these guidelines. Lessons learned from Android developers in Futurice.

Futurice 20.2k Dec 31, 2022
Learning RxJava for Android by example

Learning RxJava for Android by example This is a repository with real-world useful examples of using RxJava with Android. It usually will be in a cons

Kaushik Gopal 7.6k Dec 30, 2022