是否可以将标签文本框按钮带有选项卡式活动?特定的我添加了手绘设计照片

发布于 2025-01-22 06:58:53 字数 6005 浏览 1 评论 0原文

设计布局

它显示了应用程序的布局,我正在构建电费帐单视图,其中有其中有它顶部的选项卡活动有文本框按钮。在文本框中,当用户单击按钮时,用户将输入消费者,然后将他/她转发到应用程序的另一个活动(另一页)。显示了最后的费用和最后付款详细信息,并具有一个加上符号,例如按钮。当用户单击它时,他/她还有另外两个选项一个可以更新手机号码,还有其他选项以获取电子票据。

我在此基础上从容器中的TakeAut帮助进行了这种布局,只要我们将通过最终用户输入的文本框获得消费者编号,就可以获取消费者账单的尾巴。约束布局在整个布局中使用。

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <com.google.android.material.tabs.TabLayout
        android:id="@+id/tabLayout"
        android:layout_width="409dp"
        android:layout_height="51dp"
        android:layout_marginTop="20dp"
        android:layout_marginBottom="280dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/btn_GetDetails">

        <com.google.android.material.tabs.TabItem
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/history" />

        <com.google.android.material.tabs.TabItem
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/bookmark" />
    </com.google.android.material.tabs.TabLayout>

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="100dp"
        android:layout_marginBottom="5dp"
        android:text="@string/welcome_to_ugvcl_vij_bill"
        android:textSize="30sp"
        android:textStyle="bold"
        app:layout_constraintBottom_toTopOf="@+id/textView3"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.486"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <TextView
        android:id="@+id/textView3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:layout_marginBottom="5dp"
        android:text="@string/find_details_by_consumer_number"
        android:textSize="22sp"
        android:textStyle="bold"
        app:layout_constraintBottom_toTopOf="@+id/textInputEditText"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textView2" />

    <Button
        android:id="@+id/btn_GetDetails"
        android:layout_width="320sp"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:layout_marginBottom="64dp"
        android:text="@string/get_details"
        android:textSize="18sp"
        app:layout_constraintBottom_toTopOf="@+id/tabLayout"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.494"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textInputEditText" />

    <com.google.android.material.textfield.TextInputEditText
        android:id="@+id/textInputEditText"
        android:layout_width="320sp"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal|center_vertical"
        android:layout_marginTop="25dp"
        android:bufferType="normal"
        android:drawableStart="@drawable/ic_baseline_person_24"
        android:drawableLeft="@drawable/ic_baseline_person_24"
        android:drawablePadding="10sp"
        android:gravity="center_vertical"
        android:hint="@string/consumer_number"
        android:inputType="number"
        android:textAppearance="@style/TextAppearance.AppCompat.Display1"
        android:textSize="20sp"
        app:layout_constraintBottom_toTopOf="@+id/btn_GetDetails"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.494"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textView3"
        app:layout_constraintVertical_bias="0.0" />

</androidx.constraintlayout.widget.ConstraintLayout>

 

现在,我要做的是,当用户单击getDetails按钮时,然后在另一个活动或另一个应用程序本身中,它应该打开/显示一些消费者详细信息,例如他/她的名字,后跟他/她相应的消费者号码。它不应在任何安装的Web浏览器中打开此意图。

我编码在Web浏览器中打开此问题是...

package com.example.tabbedlayout;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;


public class MainActivity extends AppCompatActivity {

    Button button;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        button = (Button) findViewById(R.id.btn_GetDetails);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                Intent IntViewBill = new Intent(Intent.ACTION_VIEW);
                IntViewBill.setData(Uri.parse("http://ugvcl.info/UGBILL/"));
                startActivity(IntViewBill);

            }
        });

    }
}

而且工作正常。...

但是,正如我之前提到的,我希望它在应用程序本身中打开。

还有一件事,

还有一个场景,例如网页“ http://ugvcl.info/ugbill/”使用Captcha Code(将书面文本图像一起)首先由最终用户输入,以获取消费者账单的详细信息。

码头代码看起来像这样 catcha代码每次都会更改

我们如何处理。

Design Layout

it shows the layout of app i am building Electricity Bill view app, in which there is tabbed activity on top of it there is textbox button. In textbox user will enter Consumer No when user clicks button then he/she is forwarded to another activity(another page) of app. which shows last billed and last payment details and have one plus symbol like button. when user clicks on it he/she have two other option one to update mobile number and other to get E-bill.

I made this layout with help of TabLayout from Containers upon this there is one button to GetDetails of Consumer Bill provided that we will get this by Consumer number from TextBox entered by End User. Constraint Layout is used in whole layout.

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <com.google.android.material.tabs.TabLayout
        android:id="@+id/tabLayout"
        android:layout_width="409dp"
        android:layout_height="51dp"
        android:layout_marginTop="20dp"
        android:layout_marginBottom="280dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/btn_GetDetails">

        <com.google.android.material.tabs.TabItem
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/history" />

        <com.google.android.material.tabs.TabItem
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/bookmark" />
    </com.google.android.material.tabs.TabLayout>

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="100dp"
        android:layout_marginBottom="5dp"
        android:text="@string/welcome_to_ugvcl_vij_bill"
        android:textSize="30sp"
        android:textStyle="bold"
        app:layout_constraintBottom_toTopOf="@+id/textView3"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.486"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <TextView
        android:id="@+id/textView3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:layout_marginBottom="5dp"
        android:text="@string/find_details_by_consumer_number"
        android:textSize="22sp"
        android:textStyle="bold"
        app:layout_constraintBottom_toTopOf="@+id/textInputEditText"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textView2" />

    <Button
        android:id="@+id/btn_GetDetails"
        android:layout_width="320sp"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:layout_marginBottom="64dp"
        android:text="@string/get_details"
        android:textSize="18sp"
        app:layout_constraintBottom_toTopOf="@+id/tabLayout"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.494"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textInputEditText" />

    <com.google.android.material.textfield.TextInputEditText
        android:id="@+id/textInputEditText"
        android:layout_width="320sp"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal|center_vertical"
        android:layout_marginTop="25dp"
        android:bufferType="normal"
        android:drawableStart="@drawable/ic_baseline_person_24"
        android:drawableLeft="@drawable/ic_baseline_person_24"
        android:drawablePadding="10sp"
        android:gravity="center_vertical"
        android:hint="@string/consumer_number"
        android:inputType="number"
        android:textAppearance="@style/TextAppearance.AppCompat.Display1"
        android:textSize="20sp"
        app:layout_constraintBottom_toTopOf="@+id/btn_GetDetails"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.494"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textView3"
        app:layout_constraintVertical_bias="0.0" />

</androidx.constraintlayout.widget.ConstraintLayout>

 

Now what i want to do is when user clicks GetDetails Button then in Another Activity or Another Page of Application itself it should open/show some of Consumer Details like his/her name followed by his/her corresponding Consumer number. It should not fire intent to open this in any installed web browser.

I coded for opening this in web browser is...

package com.example.tabbedlayout;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;


public class MainActivity extends AppCompatActivity {

    Button button;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        button = (Button) findViewById(R.id.btn_GetDetails);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                Intent IntViewBill = new Intent(Intent.ACTION_VIEW);
                IntViewBill.setData(Uri.parse("http://ugvcl.info/UGBILL/"));
                startActivity(IntViewBill);

            }
        });

    }
}

and works fine....

But as i mentioned earlier i want it to open in app itself.

One more thing,

there is a scenario like web page "http://ugvcl.info/UGBILL/" uses Captcha Code(Image of Written TextNumber together) to be Entered first by End User to get details of Consumer Bill.

captcha code looks like this Captcha code changes everytime

How can we handle that.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

回首观望 2025-01-29 06:58:53

我在此基础上从容器中的TakeAut帮助进行了这种布局,只要我们将通过最终用户输入的文本框获得消费者编号,就可以获取消费者账单的尾巴。约束布局在整个布局中使用。

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <com.google.android.material.tabs.TabLayout
        android:id="@+id/tabLayout"
        android:layout_width="409dp"
        android:layout_height="51dp"
        android:layout_marginTop="20dp"
        android:layout_marginBottom="280dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/btn_GetDetails">

        <com.google.android.material.tabs.TabItem
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/history" />

        <com.google.android.material.tabs.TabItem
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/bookmark" />
    </com.google.android.material.tabs.TabLayout>

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="100dp"
        android:layout_marginBottom="5dp"
        android:text="@string/welcome_to_ugvcl_vij_bill"
        android:textSize="30sp"
        android:textStyle="bold"
        app:layout_constraintBottom_toTopOf="@+id/textView3"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.486"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <TextView
        android:id="@+id/textView3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:layout_marginBottom="5dp"
        android:text="@string/find_details_by_consumer_number"
        android:textSize="22sp"
        android:textStyle="bold"
        app:layout_constraintBottom_toTopOf="@+id/textInputEditText"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textView2" />

    <Button
        android:id="@+id/btn_GetDetails"
        android:layout_width="320sp"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:layout_marginBottom="64dp"
        android:text="@string/get_details"
        android:textSize="18sp"
        app:layout_constraintBottom_toTopOf="@+id/tabLayout"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.494"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textInputEditText" />

    <com.google.android.material.textfield.TextInputEditText
        android:id="@+id/textInputEditText"
        android:layout_width="320sp"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal|center_vertical"
        android:layout_marginTop="25dp"
        android:bufferType="normal"
        android:drawableStart="@drawable/ic_baseline_person_24"
        android:drawableLeft="@drawable/ic_baseline_person_24"
        android:drawablePadding="10sp"
        android:gravity="center_vertical"
        android:hint="@string/consumer_number"
        android:inputType="number"
        android:textAppearance="@style/TextAppearance.AppCompat.Display1"
        android:textSize="20sp"
        app:layout_constraintBottom_toTopOf="@+id/btn_GetDetails"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.494"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textView3"
        app:layout_constraintVertical_bias="0.0" />

</androidx.constraintlayout.widget.ConstraintLayout>

简而言之,您可以使用TableAut或一些保证金属性来实现此类布局。

I made this layout with help of TabLayout from Containers upon this there is one button to GetDetails of Consumer Bill provided that we will get this by Consumer number from TextBox entered by End User. Constraint Layout is used in whole layout.

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <com.google.android.material.tabs.TabLayout
        android:id="@+id/tabLayout"
        android:layout_width="409dp"
        android:layout_height="51dp"
        android:layout_marginTop="20dp"
        android:layout_marginBottom="280dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/btn_GetDetails">

        <com.google.android.material.tabs.TabItem
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/history" />

        <com.google.android.material.tabs.TabItem
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/bookmark" />
    </com.google.android.material.tabs.TabLayout>

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="100dp"
        android:layout_marginBottom="5dp"
        android:text="@string/welcome_to_ugvcl_vij_bill"
        android:textSize="30sp"
        android:textStyle="bold"
        app:layout_constraintBottom_toTopOf="@+id/textView3"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.486"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <TextView
        android:id="@+id/textView3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:layout_marginBottom="5dp"
        android:text="@string/find_details_by_consumer_number"
        android:textSize="22sp"
        android:textStyle="bold"
        app:layout_constraintBottom_toTopOf="@+id/textInputEditText"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textView2" />

    <Button
        android:id="@+id/btn_GetDetails"
        android:layout_width="320sp"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:layout_marginBottom="64dp"
        android:text="@string/get_details"
        android:textSize="18sp"
        app:layout_constraintBottom_toTopOf="@+id/tabLayout"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.494"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textInputEditText" />

    <com.google.android.material.textfield.TextInputEditText
        android:id="@+id/textInputEditText"
        android:layout_width="320sp"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal|center_vertical"
        android:layout_marginTop="25dp"
        android:bufferType="normal"
        android:drawableStart="@drawable/ic_baseline_person_24"
        android:drawableLeft="@drawable/ic_baseline_person_24"
        android:drawablePadding="10sp"
        android:gravity="center_vertical"
        android:hint="@string/consumer_number"
        android:inputType="number"
        android:textAppearance="@style/TextAppearance.AppCompat.Display1"
        android:textSize="20sp"
        app:layout_constraintBottom_toTopOf="@+id/btn_GetDetails"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.494"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textView3"
        app:layout_constraintVertical_bias="0.0" />

</androidx.constraintlayout.widget.ConstraintLayout>

In short you can use TabLayout or some margin properties to achieve this type of Layout.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文