Skip to content

fiftyonemoon/Rapid

Repository files navigation

Rapid Resize (Not Maintaining Anymore)

Switch to RapidX

Hello World!

A library that automatically resize your XML layout with device width and height. No matter your device orientation is portrait or landscape.

Important

  • Create your design with default 1080x1920 screen size.
  • For better experience hide navigation and status/notification bar.

SDK Information

minSDKVersion: 16 & maxSDKVersion: 30

Implementation

allprojects {
	repositories {
		maven { url 'https://jitpack.io' }
	}
}
implementation 'com.github.fiftyonemoon:Rapid:1.0.3.8'

Overview

This library have 5 modified views which is based on Android original views:

Attrs Usage

  • attrs Check out the attrs and their usage.

XML Usage

This is sample of layout.

(1) [RapidConstraintLayout]

<?xml version="1.0" encoding="utf-8"?>
<com.fom.rapid.views.RapidConstraintLayout xmlns:android="https://schemas.android.com/apk/res/android"
    xmlns:app="https://schemas.android.com/apk/res-auto"
    xmlns:tools="https://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:gravity="center"
    android:background="@drawable/bg"
    app:measureWith="width"  		//Measure view with width
    app:measureMargin="false" 		//Keep applied margin as it is
    app:measurePadding="true" 		//Resize applied padding
    app:resizeChildren="true"		//Resize this parent (RapidConstraintLayout) children
    tools:context=".MainActivity">

    <!--Add your views here-->

</com.fom.rapid.views.RapidConstraintLayout>

Device Sample

(1) 720x1280 (2) 1080x1920

720x1280 1080x1920

(3) Landscape 720x1280

720x1280