实现安卓前端“我的”页面,加载页

master
张露 3 years ago
parent ed3d4a31f2
commit c9c33dd649

@ -3,21 +3,27 @@
package="com.example.myapplication">
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.MyApplication">
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:exported="true">
android:name=".activity.LauncherActivity"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activity.MainActivity"
android:exported="true">
</activity>
</application>
</manifest>

@ -1,14 +0,0 @@
package com.example.myapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}

@ -0,0 +1,14 @@
package com.example.myapplication;
import android.app.Application;
import com.xuexiang.xui.XUI;
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
XUI.init(this);
XUI.debug(true);
}
}

@ -0,0 +1,87 @@
package com.example.myapplication.activity;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import com.example.myapplication.R;
import com.example.myapplication.databinding.ActivityLauncherBinding;
import com.xuexiang.xui.widget.banner.anim.select.ZoomInEnter;
import com.xuexiang.xui.widget.banner.transform.RotateDownTransformer;
import com.xuexiang.xui.widget.banner.widget.banner.SimpleGuideBanner;
import java.util.ArrayList;
import java.util.List;
public class LauncherActivity extends AppCompatActivity {
private SimpleGuideBanner mSimpleGuideBanner;
private ActivityLauncherBinding binding;
private Boolean isJump = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityLauncherBinding.inflate(this.getLayoutInflater());
setContentView(binding.getRoot());
mSimpleGuideBanner = binding.sgb;
showSimpleGuideBanner();
startThread();
}
public void startThread(){
Thread myThread = new Thread() {//创建子线程
@Override
public void run() {
try {
sleep(2000);//使程序休眠一秒
pageJump();
} catch (Exception e) {
e.printStackTrace();
}
}
};
myThread.start();//启动线程
}
private void showSimpleGuideBanner() {
mSimpleGuideBanner
.setIndicatorWidth(6)
.setIndicatorHeight(6)
.setIndicatorGap(12)
.setIndicatorCornerRadius(3.5f)
.setSelectAnimClass(ZoomInEnter.class)//设置显示器选中动画
.setTransformerClass(RotateDownTransformer.class)//页面滚动效果
.barPadding(0, 10, 0, 10)
.setSource(getUserGuides())//设置图片资源
.startScroll();
//点击跳过或者立即体验的监听
mSimpleGuideBanner.setOnJumpClickListener(new SimpleGuideBanner.OnJumpClickListener() {
@Override
public void onJumpClick() {
pageJump();
}
});
}
public void pageJump(){
//跳转到 MainActivity
if(!isJump){
Intent intent = new Intent(LauncherActivity.this, MainActivity.class);
startActivity(intent);
isJump = true;
this.finish();//关闭当前活动
}
}
private static List<Object> getUserGuides() {
List<Object> list = new ArrayList<>();
list.add(R.drawable.page_launcher);
return list;
}
}

@ -0,0 +1,92 @@
package com.example.myapplication.activity;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.viewpager.widget.ViewPager;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.FrameLayout;
import com.example.myapplication.R;
import com.example.myapplication.databinding.ActivityMainBinding;
import com.example.myapplication.fragment.DeviseFragment;
import com.example.myapplication.fragment.HomeFragment;
import com.example.myapplication.fragment.LocationFragment;
import com.example.myapplication.fragment.MineFragment;
import com.example.myapplication.fragment.TraceFragment;
import com.jpeng.jptabbar.JPTabBar;
import com.jpeng.jptabbar.OnTabSelectListener;
import com.jpeng.jptabbar.anno.NorIcons;
import com.jpeng.jptabbar.anno.SeleIcons;
import com.jpeng.jptabbar.anno.Titles;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity {
private ActivityMainBinding binding;
private JPTabBar tabbar;
private List<Fragment> mFragments;
@Titles
private static final String[] mTitles = {"首页","踪迹","定位","我的"};
@SeleIcons
private static final int[] mSeleIcons = {R.mipmap.tab_home_selected,R.mipmap.tab_trace_selected,R.mipmap.tab_position_selected,R.mipmap.tab_mine_selected};
@NorIcons
private static final int[] mNormalIcons = {R.mipmap.tab_home_normal,R.mipmap.tab_trace_normal,R.mipmap.tab_position_normal,R.mipmap.tab_mine_normal};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityMainBinding.inflate(this.getLayoutInflater());
setContentView(binding.getRoot());
tabbar = binding.tabbar;
initFragments();
//导航栏设置监听器
tabbar.setTabListener(new OnTabSelectListener() {
@Override
public void onTabSelect(int index) {
setCurrentFragment(index);
Log.i("tabbar", "onTabSelect: 我监听"+index);
}
@Override
public void onClickMiddle(View middleBtn) {
}
});
}
public void setCurrentFragment(int i) {
FragmentManager fm = getSupportFragmentManager();
Bundle bundle = new Bundle();
if(i==1){
bundle.putString("jumpPage", "route");
mFragments.get(i).setArguments(bundle);
}else if(i==2){
bundle.putString("jumpPage", "position");
mFragments.get(i).setArguments(bundle);
}
FragmentTransaction trans = fm.beginTransaction();
trans.replace(R.id.frag_layout, mFragments.get(i));
trans.commit();
}
public void initFragments() {
mFragments = new ArrayList<>();
mFragments.add(new HomeFragment());
mFragments.add(new DeviseFragment());
mFragments.add(new DeviseFragment());
mFragments.add(new MineFragment());
}
}

@ -0,0 +1,38 @@
package com.example.myapplication.adapter;
import androidx.annotation.NonNull;
import com.example.myapplication.R;
import com.xuexiang.xui.adapter.recyclerview.BaseRecyclerAdapter;
import com.xuexiang.xui.adapter.recyclerview.RecyclerViewHolder;
import com.xuexiang.xui.adapter.simple.AdapterItem;
import com.xuexiang.xui.widget.imageview.ImageLoader;
import com.xuexiang.xui.widget.imageview.RadiusImageView;
public class CommonGridAdapter extends BaseRecyclerAdapter<AdapterItem> {
private boolean mIsCircle;
public CommonGridAdapter(boolean isCircle) {
super();
mIsCircle = isCircle;
}
@Override
protected int getItemLayoutId(int viewType) {
return R.layout.adapter_common_grid_item;
}
@Override
protected void bindData(@NonNull RecyclerViewHolder holder, int position, AdapterItem item) {
if (item != null) {
RadiusImageView imageView = holder.findViewById(R.id.riv_item);
imageView.setCircle(mIsCircle);
ImageLoader.get().loadImage(imageView, item.getIcon());
holder.text(R.id.tv_title, item.getTitle().toString().substring(0, 1));
holder.text(R.id.tv_sub_title, item.getTitle());
}
}
}

@ -0,0 +1,47 @@
package com.example.myapplication.adapter;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.myapplication.R;
import com.example.myapplication.entity.DeviseEntity;
import java.util.List;
public class DeviseAdapter extends RecyclerView.Adapter<DeviseAdapter.ViewHolder>{
private List<DeviseEntity> list;
private FragmentManager manager;
public DeviseAdapter(List<DeviseEntity> list, FragmentManager manager) {
this.list = list;
this.manager = manager;
}
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return null;
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
}
@Override
public int getItemCount() {
return list.size();
}
static class ViewHolder extends RecyclerView.ViewHolder {
public ViewHolder(@NonNull View itemView) {
super(itemView);
}
}
}

@ -0,0 +1,4 @@
package com.example.myapplication.entity;
public class DeviseEntity {
}

@ -0,0 +1,41 @@
package com.example.myapplication.fragment;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.myapplication.databinding.FragmentDeviseBinding;
public class DeviseFragment extends Fragment {
FragmentDeviseBinding binding;
private String jumpPage;
private static final String ARG_PARAM1 = "jumpPage";
public DeviseFragment() {
// Required empty public constructor
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
jumpPage = getArguments().getString(ARG_PARAM1);
Log.i("devise", "onCreate: 在碎片中获得devise" + jumpPage);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
binding = FragmentDeviseBinding.inflate(inflater, container, false);
return binding.getRoot();
}
}

@ -0,0 +1,66 @@
package com.example.myapplication.fragment;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.myapplication.R;
/**
* A simple {@link Fragment} subclass.
* Use the {@link HomeFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class HomeFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
public HomeFragment() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment HomeFragment.
*/
// TODO: Rename and change types and number of parameters
public static HomeFragment newInstance(String param1, String param2) {
HomeFragment fragment = new HomeFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_home, container, false);
}
}

@ -0,0 +1,66 @@
package com.example.myapplication.fragment;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.myapplication.R;
/**
* A simple {@link Fragment} subclass.
* Use the {@link LocationFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class LocationFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
public LocationFragment() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment LocationFragment.
*/
// TODO: Rename and change types and number of parameters
public static LocationFragment newInstance(String param1, String param2) {
LocationFragment fragment = new LocationFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_location, container, false);
}
}

@ -0,0 +1,68 @@
package com.example.myapplication.fragment;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.myapplication.R;
import com.example.myapplication.adapter.CommonGridAdapter;
import com.example.myapplication.databinding.FragmentMineBinding;
import com.xuexiang.xui.adapter.simple.AdapterItem;
import com.xuexiang.xui.utils.ResUtils;
import com.xuexiang.xui.utils.WidgetUtils;
import java.util.ArrayList;
import java.util.List;
public class MineFragment extends Fragment {
RecyclerView recyclerHead;
FragmentMineBinding binding;
private CommonGridAdapter mGridAdapter;
public MineFragment() {
// Required empty public constructor
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
binding = FragmentMineBinding.inflate(inflater, container, false);
recyclerHead = binding.recyclerHead;
initTools();
return binding.getRoot();
}
public void initTools(){
WidgetUtils.initGridRecyclerView(recyclerHead, 4, 0);
recyclerHead.setAdapter(mGridAdapter = new CommonGridAdapter(true));
mGridAdapter.refresh(getGridItems(this.getActivity(),R.array.grid_titles_entry,R.array.grid_icons_entry));
}
private static List<AdapterItem> getGridItems(Context context, int titleArrayId, int iconArrayId) {
List<AdapterItem> list = new ArrayList<>();
String[] titles = ResUtils.getStringArray(titleArrayId);
Drawable[] icons = ResUtils.getDrawableArray(context, iconArrayId);
for (int i = 0; i < titles.length; i++) {
list.add(new AdapterItem(titles[i], icons[i]));
}
Log.i("TAB", "getGridItems: "+list.size());
return list;
}
}

@ -0,0 +1,36 @@
package com.example.myapplication.fragment;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.myapplication.R;
import com.example.myapplication.databinding.FragmentMineBinding;
import com.example.myapplication.databinding.FragmentTraceBinding;
public class TraceFragment extends Fragment {
FragmentTraceBinding binding;
private String[] titles = {"今天","昨天"};
public TraceFragment() {
// Required empty public constructor
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
binding = FragmentTraceBinding.inflate(inflater, container, false);
binding.easyIndicator2.setTabTitles(titles);
return binding.getRoot();
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!--left to right-->
<gradient
android:angle="45"
android:endColor="#FF6100"
android:startColor="#FFD3B0" />
</shape>

@ -0,0 +1,12 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!--left to right-->
<gradient
android:angle="45"
android:endColor="#FF6100"
android:startColor="#FFD3B0" />
<corners android:radius="3dp" />
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 747 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 686 B

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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=".activity.LauncherActivity">
<com.xuexiang.xui.widget.banner.widget.banner.SimpleGuideBanner
android:id="@+id/sgb"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:bb_barPaddingLeft="8dp"
app:bb_isLoopEnable="false" />
</LinearLayout>

@ -1,18 +1,21 @@
<?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"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<FrameLayout
android:id="@+id/frag_layout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<com.jpeng.jptabbar.JPTabBar
android:id="@+id/tabbar"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_gravity="bottom"
android:background="#F9F9F9" />
</LinearLayout>

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<com.xuexiang.xui.widget.alpha.XUIAlphaLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/ll_container"
android:layout_width="match_parent"
android:layout_height="80dp"
android:gravity="center"
android:orientation="vertical">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<com.xuexiang.xui.widget.imageview.RadiusImageView
android:id="@+id/riv_item"
android:layout_width="50dp"
android:layout_height="50dp"
tools:src="@mipmap/ic_launcher" />
</FrameLayout>
<TextView
android:id="@+id/tv_sub_title"
android:textColor="@color/black"
style="@style/TextStyle.Explain"
android:layout_marginTop="5dp"
tools:text="菜单1" />
</com.xuexiang.xui.widget.alpha.XUIAlphaLinearLayout>

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:layout_marginTop="10dp"
android:layout_marginEnd="@dimen/activity_horizontal_margin"
android:layout_marginBottom="6dp"
app:cardBackgroundColor="@color/xui_config_color_white"
app:cardCornerRadius="8dp"
app:cardElevation="4dp"
app:cardPreventCornerOverlap="true"
app:contentPaddingBottom="10dp"
app:contentPaddingLeft="@dimen/activity_horizontal_margin"
app:contentPaddingRight="@dimen/activity_horizontal_margin"
app:contentPaddingTop="5dp">
<!-- <include layout="@layout/layout_devise_card_item" />-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<com.xuexiang.xui.widget.imageview.RadiusImageView
android:id="@+id/iv_image"
android:layout_width="100dp"
android:layout_height="80dp"
android:layout_marginStart="8dp"
android:scaleType="centerCrop"
android:src="@drawable/normal_photo"
app:riv_border_width="0dp"
app:riv_corner_radius="5dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="20dp"
android:text="设备-1"
android:textColor="@color/black"
android:textSize="@dimen/mine_ques_top" />
</LinearLayout>
</androidx.cardview.widget.CardView>

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:background="@color/xui_config_color_white"
android:orientation="vertical">
<com.xuexiang.xui.widget.layout.linkage.view.LinkageTextView
style="@style/TextStyle.Title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start|center_vertical"
android:padding="@dimen/spacing_16"
android:text="已授权设备" />
<include layout="@layout/devise_cardview"/>
<!-- <com.xuexiang.xui.widget.layout.linkage.LinkageScrollLayout-->
<!-- android:id="@+id/lsl_container"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:scrollbars="vertical">-->
<!--&lt;!&ndash; <com.xuexiang.xui.widget.layout.linkage.view.LinkageRecyclerView&ndash;&gt;-->
<!--&lt;!&ndash; android:id="@+id/recyclerView"&ndash;&gt;-->
<!--&lt;!&ndash; android:layout_width="match_parent"&ndash;&gt;-->
<!--&lt;!&ndash; android:layout_height="match_parent"&ndash;&gt;-->
<!--&lt;!&ndash; android:overScrollMode="never"&ndash;&gt;-->
<!--&lt;!&ndash; tools:listitem="@layout/devise_cardview" />&ndash;&gt;-->
<!-- </com.xuexiang.xui.widget.layout.linkage.LinkageScrollLayout>-->
</LinearLayout>

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_gray"
tools:context=".fragment.HomeFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
</FrameLayout>

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_gray"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".fragment.LocationFragment">
<com.xuexiang.xui.widget.actionbar.TitleBar
android:id="@+id/titlebar"
app:tb_leftImageResource="@drawable/icon_back_white"
app:tb_leftText="返回"
app:tb_titleText="设备-1"
app:tb_useThemeColor="false"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_gradient_titlebar_background"
android:layout_marginTop="5dp" />
</FrameLayout>

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_gray"
android:orientation="vertical">
<com.xuexiang.xui.widget.alpha.XUIAlphaLinearLayout
android:layout_marginTop="10dp"
android:layout_width="380dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/white"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
android:padding="50dp">
<com.xuexiang.xui.widget.button.shadowbutton.ShadowButton
android:layout_width="64dp"
android:layout_height="64dp"
android:background="@drawable/normal_photo"
app:sb_shape_type="round" />
<com.xuexiang.xui.widget.button.roundbutton.RoundButton
style="@style/RoundButton.Auto"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textColor="@color/xui_default_round_btn_white_text"
app:rb_backgroundColor="@color/theme_color"
android:text="立即登录"
app:rb_borderColor="@color/theme_color"
app:rb_isRadiusAdjustBounds="true" />
</com.xuexiang.xui.widget.alpha.XUIAlphaLinearLayout>
<com.xuexiang.xui.widget.alpha.XUIAlphaLinearLayout
android:layout_width="380dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="50dp"
android:background="@color/white"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
android:padding="15dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tools_head"
android:textColor="@color/black"
android:textSize="@dimen/mine_ques_top"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_head"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="?attr/xui_config_content_spacing_vertical"
android:overScrollMode="never" />
</com.xuexiang.xui.widget.alpha.XUIAlphaLinearLayout>
</LinearLayout>

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:background="@color/bg_gray"
android:orientation="vertical"
tools:context=".fragment.TraceFragment">
<com.xuexiang.xui.widget.actionbar.TitleBar
android:id="@+id/titlebar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@drawable/shape_gradient_titlebar_background"
app:tb_leftImageResource="@drawable/icon_back_white"
app:tb_leftText="返回"
app:tb_titleText="这是一个Title"
app:tb_useThemeColor="false" />
<com.xuexiang.xui.widget.tabbar.EasyIndicator
android:id="@+id/easy_indicator2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
app:indicator_height="42dp"
app:indicator_line_height="5dp"
app:indicator_line_res="@drawable/shape_indicator_line"
app:indicator_line_show="true"
app:indicator_line_width="30dp"
app:indicator_selected_color="#FF6100"
app:indicator_textSize="14sp"
app:indicator_vertical_line_h="30dp"
app:indicator_vertical_line_w="1dp"
app:indicator_width="300dp" />
<com.xuexiang.xui.widget.layout.linkage.LinkageScrollLayout
android:id="@+id/lsl_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical">
<com.xuexiang.xui.widget.layout.linkage.view.LinkageRecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
tools:listitem="@layout/trace_cardview" />
</com.xuexiang.xui.widget.layout.linkage.LinkageScrollLayout>
</LinearLayout>

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/bg_gray"
android:orientation="horizontal">
<com.xuexiang.xui.widget.imageview.RadiusImageView
android:id="@+id/iv_image"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginStart="8dp"
android:scaleType="centerCrop"
android:src="@drawable/glass"
app:riv_border_width="0dp"
app:riv_corner_radius="5dp" />
<TextView
android:layout_marginLeft="20dp"
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="设备-1"
android:textColor="@color/black"
android:textSize="@dimen/mine_ques_top"/>
</LinearLayout>

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:layout_marginTop="10dp"
android:layout_marginEnd="@dimen/activity_horizontal_margin"
android:layout_marginBottom="6dp"
app:cardBackgroundColor="@color/xui_config_color_white"
app:cardCornerRadius="8dp"
app:cardElevation="4dp"
app:cardPreventCornerOverlap="true"
app:contentPaddingBottom="10dp"
app:contentPaddingLeft="@dimen/activity_horizontal_margin"
app:contentPaddingRight="@dimen/activity_horizontal_margin"
app:contentPaddingTop="5dp">
<!-- <include layout="@layout/layout_devise_card_item" />-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/bg_gray"
android:orientation="horizontal">
<!-- <include layout="@layout/layout_devise_card_item" />-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/bg_gray"
android:orientation="vertical">
<TextView
android:id="@+id/devise_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="20dp"
android:text="遇到斑马线"
android:textColor="@color/black"
android:textSize="30sp" />
<TextView
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="20dp"
android:layout_marginTop="10sp"
android:text="2021-3-4 12:30"
android:textColor="@color/date"
android:textSize="20sp" />
</LinearLayout>
<TextView
android:id="@+id/de"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="80dp"
android:text="避让成功"
android:textColor="@color/xui_btn_green_normal_color"
android:textSize="20sp" />
</LinearLayout>
</androidx.cardview.widget.CardView>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 890 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -7,4 +7,17 @@
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="theme_color">#F86F33</color>
<color name="bg_gray">#F6F6F6</color>
<color name="date">#777777</color>
<color name="app_color_theme_1">#EF5362</color> <!-- Grapefruit -->
<color name="app_color_theme_2">#FE6D4B</color> <!-- Bittersweet -->
<color name="app_color_theme_3">#FFCF47</color> <!-- Sunflower -->
<color name="app_color_theme_4">#9FD661</color> <!-- Grass -->
<color name="app_color_theme_5">#3FD0AD</color> <!-- Mint -->
<color name="app_color_theme_6">#2BBDF3</color> <!-- Aqua -->
<color name="app_color_theme_7">#5A9AEF</color> <!-- Blue Jeans -->
<color name="app_color_theme_8">#AC8FEF</color> <!-- Lavender -->
<color name="app_color_theme_9">#EE85C1</color> <!-- Pink Rose -->
</resources>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="mine_ques_top">20sp</dimen>
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="spacing_16">16dp</dimen>
</resources>

@ -1,3 +1,20 @@
<resources>
<string name="app_name">My Application</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="tools_head">常用功能</string>
<string-array name="grid_titles_entry">
<item>添加设备</item>
<item>常见问题</item>
<item>客服</item>
</string-array>
<!-- 修改这里的图标 -->
<string-array name="grid_icons_entry">
<item>@drawable/tool_devise</item>
<item>@drawable/tool_ques</item>
<item>@drawable/tool_assist</item>
</string-array>
</resources>

@ -1,16 +1,16 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.MyApplication" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
<style name="AppTheme" parent="XUITheme.Phone">
<!-- Customize your own theme style -->
<!-- <item name="colorPrimary">@color/colorPrimary</item>-->
<!-- <item name="colorPrimaryDark">@color/colorPrimaryDark</item>-->
<!-- <item name="colorAccent">@color/colorAccent</item>-->
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
Loading…
Cancel
Save