All Projects → VladimirWrites → tools-sample

VladimirWrites / tools-sample

Licence: Apache-2.0 license
Collection of examples on how to improve preview of your layout

Projects that are alternatives of or similar to tools-sample

Jetquotes
🔖 A Quotes Application built to Demonstrate the Jetpack Compose UI
Stars: ✭ 179 (+795%)
Mutual labels:  android-ui, android-studio
media-picker
Easy customizable picker for all your needs in Android application
Stars: ✭ 167 (+735%)
Mutual labels:  android-ui, android-studio
Modern Android Development
Modern Android Development tools & key points
Stars: ✭ 219 (+995%)
Mutual labels:  android-ui, android-studio
Notzz App
📝 A Simple Note-Taking App built to demonstrate the use of Modern Android development tools - (Kotlin, Coroutines, State Flow, Hilt-Dependency Injection, Jetpack DataStore, Architecture Components, MVVM, Room, Material Design Components).
Stars: ✭ 158 (+690%)
Mutual labels:  android-ui, android-studio
GitReposCompose
GitReposCompose is an Android application 📱 for showcasing Jetpack Compose for building declarative UI in Android. This demo app uses Github public API for fetching public repositories.
Stars: ✭ 32 (+60%)
Mutual labels:  android-ui, android-studio
Customrefreshview
一个支持网络错误重试,无数据页(可自定义),无网络界面(可自定义)的上拉加载更多,下拉刷新控件
Stars: ✭ 160 (+700%)
Mutual labels:  android-ui, android-studio
Flourish
🎩 Flourish implements dynamic ways to show up and dismiss layouts with animations.
Stars: ✭ 150 (+650%)
Mutual labels:  layout, android-ui
Cameraxdemo
A sample camera app with CameraX API from Android Jetpack
Stars: ✭ 112 (+460%)
Mutual labels:  android-ui, android-studio
LoginDemo
No description or website provided.
Stars: ✭ 73 (+265%)
Mutual labels:  android-ui, android-studio
VideoPreLoading
Demo for video PreLoading/ PreCaching using ExoPlayer 2.13.3 in Android.
Stars: ✭ 61 (+205%)
Mutual labels:  android-ui, android-studio
Ibackdrop
A library to simply use Backdrop in your project (make it easy). Read more ->
Stars: ✭ 137 (+585%)
Mutual labels:  android-ui, android-studio
Material-Backdrop-Android
Material Backdrop
Stars: ✭ 106 (+430%)
Mutual labels:  layout, android-ui
Anychart Android
AnyChart Android Chart is an amazing data visualization library for easily creating interactive charts in Android apps. It runs on API 19+ (Android 4.4) and features dozens of built-in chart types.
Stars: ✭ 1,762 (+8710%)
Mutual labels:  android-ui, android-studio
Advancedrecycleview
♻ RecycleView with multiple view types, inner horizontal RecycleView and layout animation
Stars: ✭ 172 (+760%)
Mutual labels:  android-ui, android-studio
Android Inappbilling
A sample which uses Google's Play Billing Library and it does InApp Purchases and Subscriptions.
Stars: ✭ 114 (+470%)
Mutual labels:  android-ui, android-studio
Uistatus
一个简单且强大的Ui状态视图控制库!
Stars: ✭ 137 (+585%)
Mutual labels:  layout, android-ui
Androidkex
Extensions for Kotlin. Use the power of Kotlin to make your code smaller and beautiful.
Stars: ✭ 35 (+75%)
Mutual labels:  android-ui, android-studio
Mediapicker
Easy customizable picker for all your needs in Android application
Stars: ✭ 105 (+425%)
Mutual labels:  android-ui, android-studio
Swipelayout
A library what allows you to execute a swipe for the android platform
Stars: ✭ 150 (+650%)
Mutual labels:  layout, android-ui
Whatsapp Android App
This is sample code for layout for chatting app like Whatsapp.
Stars: ✭ 32 (+60%)
Mutual labels:  android-ui, android-studio

tools:sample

header

This repo is a collection of sample data that you can use in your project. It also contains examples on how to improve preview of your layout.

Usage

Add following code into your build.gradle.

clean.doFirst {
    println "cleanSamples"
    def samplesDir = new File(projectDir.absolutePath, "sampledata")
    if (samplesDir.exists()) {
        samplesDir.deleteDir()
    }
}
    
preBuild.doFirst {
    println "fetchSamplesStarted"
    def samplesDir = new File(projectDir.absolutePath, "sampledata")
    if (samplesDir.exists()) {
        println "samples dir already exists"
        return
    }
    samplesDir.mkdir()

    def files = ["lotr.json", "starwars.json", "hitchhikers.json", "developers.json"]
    for(fileName in files) {
        def names = new File(samplesDir, fileName)

        new URL("https://raw.githubusercontent.com/VladimirWrites/tools-sample/master/sampledata/$fileName").withInputStream { i ->
            names.withOutputStream {
               it << i
            }
        }
        println "fetchSample: $fileName"
    }
    println "fetchSamplesEnded"
}

After you rebuild your project, you will have files defined in files array in your sampledata folder. Now you can use the sample data in your layout like this:

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    tools:text="@sample/lotr.json/characters/name" />

Credits

License

Copyright 2018 Vladimir Jovanovic

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].