安卓期末大作業(yè)——仿番茄免費(fèi)小說(shuō)APP
APP名稱:?番茄免費(fèi)小說(shuō)
要求:
格式:宋體,小四號(hào)字;首行縮進(jìn);行距:1.5倍。
每人獨(dú)立完成Android App的設(shè)計(jì)與開(kāi)發(fā)
App必須包含SOLite數(shù)據(jù)庫(kù)操作
一、所調(diào)查的App簡(jiǎn)介。(限200字以內(nèi))
番茄小說(shuō)是抖音 旗下的免費(fèi)網(wǎng)文閱讀APP,致力于為讀者提供暢快不花錢的極致閱讀體驗(yàn),于2019年11月正式上線。
番茄小說(shuō)擁有海量正版小說(shuō),涵蓋言情、玄幻、懸疑、都市等全部主流網(wǎng)文類型,以及大量熱劇原著和經(jīng)典出版物,支持用戶看書(shū)聽(tīng)書(shū)。
你要參照的App的界面截圖及界面對(duì)應(yīng)的流程圖和功能圖,并給出具體的文字說(shuō)明。
?
安卓期末大作業(yè)——仿番茄免費(fèi)小說(shuō)APP
安卓期末大作業(yè)——仿番茄免費(fèi)小說(shuō)APP[/caption]
安卓期末大作業(yè)——仿番茄免費(fèi)小說(shuō)APP[/caption]
功能圖


參照的App的界面截圖

三、技術(shù)剖析(調(diào)查的App界面可以運(yùn)用哪些課程所學(xué)內(nèi)容實(shí)現(xiàn),請(qǐng)對(duì)照一一說(shuō)明)
3.1?首頁(yè)
首頁(yè)從上往下整體可以用垂直的線性布局實(shí)現(xiàn),頂部的搜索框可以用RelativeLayout相對(duì)布局實(shí)現(xiàn),接下來(lái)的4×4的排行榜可以HorizontalScrollView和RecyclerView瀑布流實(shí)現(xiàn)。
底部導(dǎo)航欄可以用成熟的BottomNavigationView技術(shù)方案實(shí)現(xiàn),底部導(dǎo)航圖片可以采用ventor矢量圖標(biāo)。
3.2 榜單
可以用左右組合RecyclerView列表實(shí)現(xiàn),根據(jù)左側(cè)分類動(dòng)態(tài)顯示右側(cè)的書(shū)籍。
3.3 書(shū)架
可以采用3列布局的列表實(shí)現(xiàn),單擊事件可以查看書(shū)籍詳情,長(zhǎng)按事件可以刪除書(shū)籍
3.4 我的
可以采用ConstraintLayout布局實(shí)現(xiàn)。退出登錄可以通過(guò)button按鈕單擊事件實(shí)現(xiàn)
四、App實(shí)現(xiàn)
1.界面完成的截圖


?
2.界面布局代碼
首頁(yè)
<?xml version=”1.0″ encoding=”utf-8″?>
<LinearLayout?xmlns:android=” ”
xmlns:app=” ”
xmlns:tools=” ”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
tools:context=”.ui.home.HomeFragment”
android:orientation=”vertical”>
<RelativeLayout
android:id=”@+id/re1″
android:layout_width=”match_parent”
android:layout_height=”70dp”
android:background=”#E6E8EA”>
<RelativeLayout
android:layout_width=”match_parent”
android:layout_height=”42dp”
android:layout_centerInParent=”true”
android:layout_marginLeft=”50dp”
android:background=”@drawable/back3″>
<ImageView
android:layout_width=”35dp”
android:layout_height=”35dp”
android:layout_centerVertical=”true”
android:layout_marginLeft=”5dp”
android:background=”@drawable/ic_baseline_search_24″ />
<EditText
android:id=”@+id/edinput”
android:layout_width=”match_parent”
android:layout_height=”50dp”
android:layout_marginLeft=”43dp”
android:layout_marginRight=”55dp”
android:background=”#FCFDFD”
android:hint=”請(qǐng)輸入搜索內(nèi)容” />
<TextView
android:id=”@+id/tv_refresh1″
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_alignParentRight=”true”
android:layout_centerVertical=”true”
android:layout_marginRight=”10dp”
android:text=”搜索”
android:textColor=”#A60F43″
android:textSize=”17dp” />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width=”match_parent”
android:layout_height=”wrap_content”>
<TextView
android:id=”@+id/tv_rank”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:text=”排行榜”
android:textSize=”32dp”
android:textStyle=”bold”
/>
<TextView
android:id=”@+id/all_rank”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:text=”完整榜單>”
android:textSize=”24dp”
android:layout_alignParentRight=”true”
/>
</RelativeLayout>
<HorizontalScrollView
android:layout_width=”match_parent”
android:layout_height=”match_parent”>
<androidx.recyclerview.widget.RecyclerView
android:id=”@+id/homeRecyclerView”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:background=”@color/colorContent”
android:overScrollMode=”never”
app:layout_constraintBottom_toBottomOf=”parent”
app:layout_constraintEnd_toEndOf=”parent”
app:layout_constraintHorizontal_bias=”0.0″
app:layout_constraintStart_toStartOf=”parent”
app:layout_constraintTop_toTopOf=”parent” />
</HorizontalScrollView>
</LinearLayout>榜單
<?xml version=”1.0″ encoding=”utf-8″?>
<LinearLayout xmlns:android=”
”xmlns:tools=”
”android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:orientation=”horizontal”
android:weightSum=”10″
tools:context=”.ui.snack.SnackFragment”>
<LinearLayout
android:layout_width=”0dp”
android:layout_height=”match_parent”
android:layout_weight=”2″
android:orientation=”vertical”>
<androidx.recyclerview.widget.RecyclerView
android:id=”@+id/snackLeftRecyclerView”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:background=”#4DEEEEEE”
android:overScrollMode=”never” />
</LinearLayout>
<LinearLayout
android:layout_width=”0dp”
android:layout_height=”match_parent”
android:layout_weight=”8″
android:orientation=”vertical”
android:overScrollMode=”never”>
<androidx.recyclerview.widget.RecyclerView
android:id=”@+id/snackRightRecyclerView”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:background=”@color/colorBgWhite”
android:overScrollMode=”never” />
</LinearLayout>
</LinearLayout>
書(shū)架
<?xml version=”1.0″ encoding=”utf-8″?>
<LinearLayout xmlns:android=” ”
xmlns:tools=” ”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:orientation=”vertical”
tools:context=”.ui.place.PlaceFragment”>
<androidx.recyclerview.widget.RecyclerView
android:id=”@+id/placeRecyclerView”
android:layout_width=”match_parent”
android:layout_height=”0dp”
android:layout_weight=”1″
android:background=”@color/colorContent”
android:overScrollMode=”never” />
</LinearLayout>我的
<?xml version=”1.0″ encoding=”utf-8″?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=”
”xmlns:app=”
”xmlns:tools=”
”android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:background=”@color/colorContent”
tools:context=”.ui.my.MyFragment”>
<ScrollView
android:layout_width=”0dp”
android:layout_height=”0dp”
android:overScrollMode=”never”
app:layout_constraintBottom_toBottomOf=”parent”
app:layout_constraintEnd_toEndOf=”parent”
app:layout_constraintStart_toStartOf=”parent”
app:layout_constraintTop_toTopOf=”parent”>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=”match_parent”
android:layout_height=”wrap_content”>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=”@+id/constraintLayout”
android:layout_width=”0dp”
android:layout_height=”wrap_content”
android:background=”@drawable/detail_info”
app:layout_constraintEnd_toEndOf=”parent”
app:layout_constraintStart_toStartOf=”parent”
app:layout_constraintTop_toTopOf=”parent”
tools:ignore=”MissingConstraints”>
<de.hdodenhof.circleimageview.CircleImageView
android:id=”@+id/myUserHead”
android:layout_width=”80dp”
android:layout_height=”80dp”
android:layout_marginStart=”16dp”
android:layout_marginTop=”24dp”
android:layout_marginBottom=”24dp”
android:src=”@mipmap/hejubian”
app:layout_constraintBottom_toBottomOf=”parent”
app:layout_constraintStart_toStartOf=”parent”
app:layout_constraintTop_toTopOf=”parent” />
<TextView
android:id=”@+id/myUserNickName”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_marginStart=”17dp”
android:layout_marginTop=”24dp”
android:text=”未登錄”
android:textSize=”22sp”
app:layout_constraintStart_toEndOf=”@+id/myUserHead”
app:layout_constraintTop_toTopOf=”parent” />
<TextView
android:id=”@+id/myUserName”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_marginStart=”17dp”
android:layout_marginTop=”8dp”
android:text=””
android:textSize=”18sp”
app:layout_constraintStart_toEndOf=”@+id/myUserHead”
app:layout_constraintTop_toBottomOf=”@+id/myUserNickName” />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id=”@+id/linearLayout”
android:layout_width=”0dp”
android:layout_height=”wrap_content”
android:layout_marginTop=”16dp”
android:background=”@drawable/radius_content”
android:orientation=”horizontal”
android:padding=”10sp”
android:weightSum=”4″
app:layout_constraintEnd_toEndOf=”parent”
app:layout_constraintStart_toStartOf=”parent”
app:layout_constraintTop_toBottomOf=”@+id/constraintLayout”>
<LinearLayout
android:id=”@+id/myOrderView”
android:layout_width=”0dp”
android:layout_height=”match_parent”
android:layout_weight=”1″
android:orientation=”vertical”>
<ImageView
android:layout_width=”match_parent”
android:layout_height=”55dp”
android:padding=”8dp”
android:src=”@drawable/ic_baseline_assignment_24dp” />
<TextView
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:gravity=”center_horizontal”
android:text=”我的訂單” />
</LinearLayout>
<LinearLayout
android:layout_width=”0dp”
android:layout_height=”match_parent”
android:layout_weight=”1″
android:orientation=”vertical”>
<ImageView
android:layout_width=”match_parent”
android:layout_height=”55dp”
android:padding=”8dp”
android:src=”@drawable/ic_sharp_monetization_on_24dp” />
<TextView
android:id=”@+id/textView4″
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:gravity=”center_horizontal”
android:text=”待付款” />
</LinearLayout>
<LinearLayout
android:layout_width=”0dp”
android:layout_height=”match_parent”
android:layout_weight=”1″
android:orientation=”vertical”>
<ImageView
android:layout_width=”match_parent”
android:layout_height=”55dp”
android:padding=”8dp”
android:src=”@drawable/ic_baseline_question_answer_24dp” />
<TextView
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:gravity=”center_horizontal”
android:text=”待評(píng)價(jià)” />
</LinearLayout>
<LinearLayout
android:layout_width=”0dp”
android:layout_height=”match_parent”
android:layout_weight=”1″
android:orientation=”vertical”>
<ImageView
android:layout_width=”match_parent”
android:layout_height=”55dp”
android:padding=”8dp”
android:src=”@drawable/ic_baseline_report_24dp” />
<TextView
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:gravity=”center_horizontal”
android:text=”退款” />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id=”@+id/linearLayout2″
android:layout_width=”0dp”
android:layout_height=”wrap_content”
android:layout_marginStart=”1dp”
android:layout_marginTop=”16dp”
android:background=”@drawable/radius_content”
android:orientation=”vertical”
app:layout_constraintEnd_toEndOf=”parent”
app:layout_constraintStart_toStartOf=”parent”
app:layout_constraintTop_toBottomOf=”@+id/linearLayout”>
<TextView
android:layout_width=”match_parent”
android:layout_height=”45dp”
android:gravity=”center_vertical”
android:paddingStart=”16dp”
android:text=”支付設(shè)置”
android:textSize=”18sp”
tools:ignore=”RtlSymmetry” />
<View
android:layout_width=”match_parent”
android:layout_height=”1dp”
android:background=”#EEEEEE” />
<TextView
android:id=”@+id/myModifyText”
android:layout_width=”match_parent”
android:layout_height=”45dp”
android:gravity=”center_vertical”
android:paddingStart=”16dp”
android:text=”修改地址”
android:textSize=”18sp”
tools:ignore=”RtlSymmetry” />
<LinearLayout
android:id=”@+id/myModifyView”
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:background=”#1A409EFF”
android:orientation=”vertical”
android:visibility=”gone”>
<EditText
android:id=”@+id/editTextTextPersonName2″
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:layout_marginLeft=”32sp”
android:layout_marginTop=”22sp”
android:layout_marginRight=”32sp”
android:layout_marginBottom=”12sp”
android:ems=”10″
android:hint=”請(qǐng)輸入新的手機(jī)號(hào)碼”
android:inputType=”textPersonName” />
<EditText
android:id=”@+id/editTextTextPersonName3″
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:layout_marginLeft=”32sp”
android:layout_marginTop=”12sp”
android:layout_marginRight=”32sp”
android:layout_marginBottom=”12sp”
android:ems=”10″
android:hint=”請(qǐng)輸入新的收貨地址”
android:inputType=”textPersonName” />
<Button
android:id=”@+id/myModifyBtn”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_gravity=”end”
android:layout_marginEnd=”32sp”
android:layout_marginBottom=”12sp”
android:text=”確定” />
</LinearLayout>
<View
android:layout_width=”match_parent”
android:layout_height=”1dp”
android:background=”#EEEEEE” />
</LinearLayout>
<LinearLayout
android:layout_width=”0dp”
android:layout_height=”wrap_content”
android:layout_marginTop=”16dp”
android:layout_marginBottom=”16dp”
android:background=”@drawable/radius_content”
android:orientation=”vertical”
app:layout_constraintBottom_toBottomOf=”parent”
app:layout_constraintEnd_toEndOf=”parent”
app:layout_constraintStart_toStartOf=”parent”
app:layout_constraintTop_toBottomOf=”@+id/linearLayout2″>
<TextView
android:id=”@+id/logoutBtn”
android:layout_width=”match_parent”
android:layout_height=”45dp”
android:gravity=”center”
android:paddingStart=”16dp”
android:text=”退出賬號(hào)”
android:textSize=”16sp”
tools:ignore=”RtlSymmetry” />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
3.App功能實(shí)現(xiàn)關(guān)鍵代碼
(1)首頁(yè)
private void initHomeAdapter() {
// 實(shí)例化電子書(shū)列表適配器對(duì)象
HomeAdapter adapter = new HomeAdapter(DataServer.getHomeList());
// 設(shè)置動(dòng)畫效果
adapter.setAnimationEnable(true);
// adapter.setAnimationFirstOnly(false);
// adapter.setAnimationWithDefault(BaseQuickAdapter.AnimationType.SlideInBottom);
adapter.setAdapterAnimation(new MyAnimation3());
// 設(shè)置頭部
adapter.setHeaderView(getHeadView(), 1);
// 設(shè)置尾部
adapter.setFooterView(getFooterView(), 1);
// 點(diǎn)擊事件監(jiān)聽(tīng)器
adapter.setOnItemClickListener((adapter1, view, position) -> {
Snack snack = (Snack) adapter1.getItem(position);
DetailActivity.actionStart(getContext(), snack);
});
// 設(shè)置適配器
homeRecyclerView.setAdapter(adapter);
}
榜單
/**
* 初始化左邊適配器
*/
@SuppressLint(“ResourceAsColor”)
private void initLeftAdapter() {
// 實(shí)例化左邊適配器對(duì)象
SnackLeftAdapter leftAdapter = new SnackLeftAdapter(DataServer.getSnackOrderList());
// 設(shè)置動(dòng)畫效果
leftAdapter.setAnimationEnable(true);
leftAdapter.setAnimationFirstOnly(false);
leftAdapter.setAnimationWithDefault(BaseQuickAdapter.AnimationType.SlideInLeft);
// 觸發(fā)點(diǎn)擊按鈕
leftAdapter.setOnItemClickListener((adapter, view, position) -> {
if (position != leftSelectPosition) {
String item = (String) adapter.getItem(position);
// 原本選中的item變成未選中顏色
Objects.requireNonNull(adapter.getViewByPosition(leftSelectPosition, R.id.snackLeftType)).setBackgroundResource(R.color.colorContent);
// 當(dāng)前item變成選中顏色
Objects.requireNonNull(adapter.getViewByPosition(position, R.id.snackLeftType)).setBackgroundResource(R.color.colorBgWhite);
leftSelectPosition = position;
// 刷新右邊列表
// rightAdapter.setAnimationWithDefault(BaseQuickAdapter.AnimationType.SlideInBottom);
rightAdapter.setAnimationEnable(false);
switch (position) {
case 1:
rightAdapter.setNewInstance(DataServer.getGuangxiList());
break;
case 2:
rightAdapter.setNewInstance(DataServer.getGuangzhouList());
break;
case 3:
// rightAdapter.setNewInstance(DataServer.getBeijingList());
break;
case 4:
// rightAdapter.setNewInstance(DataServer.getChongqingList());
break;
default:
rightAdapter.setNewInstance(DataServer.getFujianList());
break;
}
}
});
// 設(shè)置左邊列表適配器
leftRecyclerview.setAdapter(leftAdapter);
}
/**
* 初始化右邊適配器
*/
public void initRightAdapter() {
// 實(shí)例化右邊適配器對(duì)象
rightAdapter = new SnackRightAdapter(DataServer.getFujianList());
// 設(shè)置動(dòng)畫效果
rightAdapter.setAnimationEnable(true);
// rightAdapter.setAnimationFirstOnly(false);
rightAdapter.setAnimationWithDefault(BaseQuickAdapter.AnimationType.SlideInRight);
// 設(shè)置尾部
rightAdapter.addFooterView(getFooterView());
// 點(diǎn)擊item事件
rightAdapter.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
Snack snack = (Snack) adapter.getItem(position);
DetailActivity.actionStart(getContext(), snack);
}
});
// 左邊列表加入書(shū)架點(diǎn)擊事件
rightAdapter.addChildClickViewIds(R.id.snackRightAddBtn);
rightAdapter.setOnItemChildClickListener((adapter, view, position) -> {
Snack snack = (Snack) adapter.getItem(position);
if (view.getId() == R.id.snackRightAddBtn) {
if (!MyApplication.getCartSnacks().contains(snack)) {
// 添加到書(shū)架
snack.setCount(1);
MyApplication.getCartSnacks().add(snack);
Tips.show(“已添加” + snack.getName() + “到書(shū)架”);
} else {
Tips.show(“已在書(shū)架中,不能重復(fù)添加”);
}
}
});
// 設(shè)置右邊列表適配器
rightRecyclerView.setAdapter(rightAdapter);
}
SQLite數(shù)據(jù)庫(kù)表設(shè)計(jì)(格式如下,一個(gè)數(shù)據(jù)表對(duì)應(yīng)一個(gè)表格)
字段含義類型name書(shū)籍名稱stringprice書(shū)籍熱度doubleImage書(shū)籍圖片Intdetail書(shū)籍詳情string列名數(shù)據(jù)類型長(zhǎng)度允許空說(shuō)明usernamevarchar20N用戶名passwordvarchar30Y密碼addressvarchar100N收貨地址idint10N編號(hào)headimageint100Y頭像
5.調(diào)查的App界面中你覺(jué)得哪些設(shè)計(jì)不合理,你是如何改進(jìn)的(選做)
首頁(yè)列表在不同設(shè)備顯示的比例不同,可能導(dǎo)致美觀度不夠,可以進(jìn)一步根據(jù)不同設(shè)備進(jìn)行適配
測(cè)試用例
搜索
輸入:“黑科技1”
搜索結(jié)果:

(2)加入書(shū)架
輸入:點(diǎn)擊加入書(shū)架
結(jié)果文字:提示成功加入書(shū)架
總結(jié)(不少于500字,本次調(diào)查目的、過(guò)程、開(kāi)發(fā)經(jīng)歷等)
1)通過(guò)半個(gè)學(xué)期的學(xué)習(xí),基本掌握了Android應(yīng)用程序開(kāi)發(fā)的一般流程。對(duì)常用控件基本掌握其用法,對(duì)其事件的監(jiān)聽(tīng)方法也基本掌握。學(xué)習(xí)Android不僅是對(duì)前沿開(kāi)發(fā)技術(shù)的了解,也是對(duì)編程知識(shí)的一次提升。
2)通過(guò)學(xué)習(xí)Android的控件、布局、Activity、Service等一系列基礎(chǔ)知識(shí),對(duì)整個(gè)Android的開(kāi)發(fā)有了大致的了解。例如:要的布局(或者控件),在學(xué)習(xí)界面中,我發(fā)現(xiàn)Android為我們提供了很好的類似反射機(jī)制,通過(guò)Layout文件夾下的配置文件,可以快速的形成界面,在配置文件可以設(shè)置屬性或者樣式都是很快捷方便對(duì)比較特殊的界面也可以通過(guò)處理嵌入到指定的界面,同樣你可以通過(guò)java代碼直接創(chuàng)建View進(jìn)行添加,不過(guò)這種方式比較復(fù)雜。
3)對(duì)一些點(diǎn)擊、選中、按鍵等處理的事件,界面之間的跳轉(zhuǎn)Intent管理,通過(guò)Bundle對(duì)數(shù)據(jù)在界面之間進(jìn)行傳輸。
android是一種很錯(cuò)的手機(jī)系統(tǒng),使用起來(lái)簡(jiǎn)單,而且可以根據(jù)自己的需求選擇適合自己的版本,非常的方便。我要多多學(xué)習(xí)關(guān)于android的知識(shí),在未來(lái),將android系統(tǒng)研發(fā)的更加人性化,使用起來(lái)更加的舒適。
源碼鏈接:https://yunjunet.cn/874976.html
安卓期末大作業(yè)——仿番茄免費(fèi)小說(shuō)APP的評(píng)論 (共 條)
