weiV(pronounced the same as wave), a new declarative UI development framework based on the Android View system.

Related tags

App weiV
Overview

weiV(pronounced the same as wave)

简体中文

wave.webp

if ("weiV" == "View".reversed()) {
    Log.d(
        "weiV",
        "It means Inversion of Control, you should always manipulate the UI 's description Widget directly instead of the View."
    )
}

It has the following advantages:

  1. Declarative UI writing doubles the efficiency of native development
  2. Meets or exceeds the performance of the View system
    1. I ported my Flutter ConstraintLayout to Android, relying on its advanced layout algorithm, without introducing Intrinsic Measurement, so that the child elements in the View tree will only be laid out once in any case, making arbitrary nesting does not cause performance issues. Even if each level in the View tree is a mix of wrap_content and match_parent
    2. xml will be discarded
  3. All your existing View system experience will be retained
  4. All existing UI components will be reused

Progress

At present, the definition of DSL has been completed, and it can be parsed into a Widget tree. The DSL style is as follows:

class MainActivity : WeiVActivity() {
    private var switch = false
    private var text = "weiV"

    override fun build(): Widget {
        return WeiV {
            Flex(orientation = LinearLayout.HORIZONTAL) {
                Text(text = text, textSize = 14f)
                Text(text = text)
                Flex(
                    key = Key(),
                    orientation = LinearLayout.VERTICAL
                ) {
                    if (switch) {
                        Text(text = text)
                    } else {
                        Text(text = text)
                    }
                    repeat(10) {
                        Button(text = text + it)
                    }
                    for (i in 1..5) {
                        Text(text = text + i)
                    }
                }
            }
        }
    }
}

weiV is extensible. It will have all the commonly used widgets built in, which are wrappers for the system View. But for third-party libraries, you need to write extensions, which are extremely simple to write. For example, the extension for Button is as follows:

class weiVButton(
    override var key: Key? = null,
    var text: String? = null,
    var textSize: Float? = null,
    var textColor: Int? = null
) :
    LeafRenderWidget<Button>(key) {

    override fun createView(context: Context): Button = Button(context)

    override fun doParameter(view: Button, first: Boolean): Button {
        if (view.text != text) {
            view.text = text
        }
        if (view.currentTextColor != textColor) {
            view.setTextColor(textColor!!)
        }
        if (view.textSize != textSize) {
            view.textSize = textSize!!
        }
        return view
    }
}

fun WeiV.Button(
    key: Key? = null,
    text: String? = null,
    textSize: Float? = null,
    textColor: Int? = null
) {
    currentWidgetContext.add(
        weiVButton(
            key = key,
            text = text,
            textSize = textSize,
            textColor = textColor
        )
    )
}

It is expected that weiV will be able to actually run soon. But there is still a long way to go. First, you need to transplant Flutter ConstraintLayout, and secondly, you will probably rewrite a weiV version of RecyclerView to support simple list usage like Flutter, without writing Adapter.

Subscribe to my WeChat official account to get the latest news of weiV. Follow-up will also share some high-quality, unique, and thoughtful Flutter and Android technical articles. official_account.webp

Support me

If it helps you a lot, consider sponsoring me a cup of milk tea, or giving a star. Your support is the driving force for me to continue to maintain.

In the long run, weiV may become the third(class) high-performance cross-platform development framework after React Native and Flutter. Its front end uses kotlin DSL, and the back end uses platform native View rendering. And meet or exceed the performance of the native View system. It is also possible to develop a self-drawing engine like Flutter, which ensures full pixel consistency across platforms. Even native rendering and self-drawing can be combined, and self-drawing is preferred. When WebView needs to be embedded in the page, switch to native rendering.

Paypal support.webp

Contact

[email protected]

License

MIT License

Copyright (c) 2022 hackware1993

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
You might also like...
Android Mobile Application for Movie Reservation System.
Android Mobile Application for Movie Reservation System.

Movie-Reservation-Android-App Android Mobile Application for Movie Reservation System Brief Description of the Project 👇 “BlueSky Cinema” is an onlin

An android app that lists all planets in our solar system and brings some information about them.
An android app that lists all planets in our solar system and brings some information about them.

SolarSystem This application was developed in Android Studio and uses Kotlin as programming language. In short, it is an app that lists all the planet

Android app with a simple NFC payment system to manage visitor consumption at short-duration events and festivals. (Research project)
Android app with a simple NFC payment system to manage visitor consumption at short-duration events and festivals. (Research project)

Clevent Também disponível em Português Clevent is an Android application developed for a Undergraduate Research that uses NFC technology to create a p

A semi-official port of the open source Anki spaced repetition flashcard system to Android
A semi-official port of the open source Anki spaced repetition flashcard system to Android

AnkiDroid A semi-official port of the open source Anki spaced repetition flashcard system to Android. Memorize anything with AnkiDroid! Features night

AVTS App - S.I.T Global PBL 2021 - Automatic Visitor Tracking System Android Application

S.I.T Global PBL 2021 - Automatic Visitor Tracking System Android Application De

MyTraining - Application project for Android system using Kotlin
MyTraining - Application project for Android system using Kotlin

MyTraining Projeto de aplicação para sistema Android utilizando linguagem Kotlin

Xposed module to set the Signature Scheme for Android 30 = to 1. This allows system apps to be modified

SetSignatureSchemeV1 Xposed module to set the Signature Scheme for Android 30+ to 1. This allows system apps to be modified. This module makes the met

Space recommendation system and augmenting informations with ARCore SDK
Space recommendation system and augmenting informations with ARCore SDK

Space recommendation system and augmenting informations with ARCore SDK

An unofficial companion app for DJI's Digital FPV System.
An unofficial companion app for DJI's Digital FPV System.

fpv-dvca An unofficial companion app for DJI's Digital FPV System for Android devices. Plug your Android device into your Googles and watch a live fee

Owner
fangbing chen
An intermittent perfectionist.
fangbing chen
android-trinity is tiny proactive framework with much of the scaffolding code required to start a new Android Application.

android-trinity This is tiny framework with much of the scaffolding code (with some nice utilities and prepared source code) required to start a new A

Fernando Cejas 49 Nov 24, 2022
Android library for finding connected devices on same WiFi network. It can provide IP Address, device name, MAC Address and vendor names.

Android WiFi Tools Android library for finding connected devices on the same WiFi network. It can provide IP Addresses, device names, MAC Address and

Tej Magar 5 Nov 16, 2022
This app aims at helping people keep track of their job applications, and remind them regularly about the same.

Applications Tracker Lately I have been applying for many roles, and it has become a hard task to keep track of all the applications. Spreadsheets are

Kartik Pant 4 Feb 20, 2022
Real time gps location based alarming system tracking the road accident and providing medical assitance plus concern from near by police station.

Real time gps location based alarming system tracking the road accident and providing medical assitance plus concern from near by police station.

Sandeep Verma 1 Mar 12, 2022
Android App Development using Android Studio Project for The Swastika. It is edit profile view.

Edit_Profile_View Android App Development using Android Studio Project for The Swastika. It is edit profile view. To start with this project first is

Shradha Suryawanshi 1 Jun 12, 2022
Simple Notes app demonstrates modern Android development with Hilt, Material Motion, Coroutines, Flow, Jetpack (Room, ViewModel) based on MVVM architecture.

Simple Notes app demonstrates modern Android development with Hilt, Material Motion, Coroutines, Flow, Jetpack (Room, ViewModel) based on MVVM architecture.

Aravind Chowdary 2 Sep 3, 2022
This is a food donation android application designed to reduce food wastage by donating excess food to poor or needy people. Based on Kotlin and currently under development

FOODONOR This is a food donation android application designed to reduce food wastage by donating excess food to poor or needy people. Based on Kotlin

Robert Muriithi 8 Oct 12, 2022
A lightweight tracking framework based on the tracking idea of Buzzvideo.(基于西瓜视频的责任链埋点思路实现的轻量级埋点框架)

Tracker English | 中文 Tracker is a lightweight tracking framework based on the tracking idea of Buzzvideo. Tracking idea Why use chain of responsibilit

DylanCai 76 Dec 22, 2022