last time content

master
huan 2 years ago
parent b45f30574d
commit 7eec96f545

@ -12,6 +12,6 @@
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-04-18T06:15:51.253471Z" />
<timeTargetWasSelectedWithDropDown value="2023-05-14T03:17:23.857774700Z" />
</component>
</project>

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.orangesale.cn">
<application
@ -10,8 +11,9 @@
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".IndexActivity"
android:exported="false" />
android:name=".activity.IndexActivity"
android:exported="false"
tools:ignore="Instantiatable" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

@ -71,6 +71,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
if (cursor.getCount() > 0) {
return true;
}
//服了谁把我头像换了肯定是Rosa
return false;
}
}

@ -25,19 +25,10 @@ public class IndexActivity extends Activity implements View.OnClickListener {
private IndexFragment indexFragment;
private PersonFragment personFragment;
private LinearLayout indexLine;
private LinearLayout productLine;
private LinearLayout shoppingLine;
private LinearLayout personLine;
private LinearLayout indexLine, productLine, shoppingCartLine, personLine;
Intent timeServiceIntent;
public IndexActivity(LinearLayout productLine, LinearLayout shoppingLine, LinearLayout personLine) {
this.productLine = productLine;
this.shoppingLine = shoppingLine;
this.personLine = personLine;
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
@ -48,19 +39,18 @@ public class IndexActivity extends Activity implements View.OnClickListener {
Thread thread = new Thread(runnable);
thread.start();
}
private void init() {
indexLine = findViewById(R.id.content_index);
indexLine.setOnClickListener(this);
indexLine = findViewById(R.id.content_product);
productLine = findViewById(R.id.content_product);
productLine.setOnClickListener(this);
indexLine = findViewById(R.id.content_cart);
shoppingLine.setOnClickListener(this);
shoppingCartLine = findViewById(R.id.content_cart);
shoppingCartLine.setOnClickListener(this);
indexLine = findViewById(R.id.content_person);
productLine.setOnClickListener(this);
personLine = findViewById(R.id.content_person);
personLine.setOnClickListener(this);
}
@Override
@ -88,7 +78,7 @@ public class IndexActivity extends Activity implements View.OnClickListener {
}
private void initpersonFragment() {
android.app.FragmentTransaction transaction = getFragmentManager().beginTransaction();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (personFragment == null) {
Intent intent = IndexActivity.this.getIntent();
@ -110,7 +100,7 @@ public class IndexActivity extends Activity implements View.OnClickListener {
}
private void initproductFragment() {
android.app.FragmentTransaction transaction = getFragmentManager().beginTransaction();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (productFragment == null) {
productFragment = new ProductFragment();
}
@ -119,16 +109,12 @@ public class IndexActivity extends Activity implements View.OnClickListener {
}
private void initIndexFragment() {
androidx.fragment.app.FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (indexFragment == null) {
indexFragment = new IndexFragment();
}
transaction.replace(R.id.main_content,indexFragment);
transaction.commit();
}
private FragmentManager getSupportFragmentManager() {
return null;
transaction.replace(R.id.main_content,indexFragment);
transaction.commit();
}
Runnable runnable = () -> {
@ -145,3 +131,5 @@ public class IndexActivity extends Activity implements View.OnClickListener {

@ -1,5 +1,7 @@
package com.orangesale.cn.fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
@ -7,20 +9,17 @@ import android.view.ViewGroup;
import android.widget.GridView;
import android.widget.LinearLayout;
import android.widget.SearchView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.orangesale.cn.R;
import com.orangesale.cn.entity.Product;
import com.orangesale.cn.adapter.ProductAdapter;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class IndexFragment extends Fragment implements View.OnClickListener {
private GridView gridView;
@ -47,6 +46,7 @@ public class IndexFragment extends Fragment implements View.OnClickListener {
qichengLine.setOnClickListener(this);
bingtangchengLine = view.findViewById(R.id.bingtangcheng);
bingtangchengLine.setOnClickListener(this);
gridView = view.findViewById(R.id.index_famous_gridview);
initData();
productAdapter = new ProductAdapter(getActivity(), productList);
@ -56,7 +56,6 @@ public class IndexFragment extends Fragment implements View.OnClickListener {
@Override
public void onClick(View v) {
}
private void initData() {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

@ -1,6 +1,5 @@
<?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:id="@+id/activity_main"
android:layout_width="match_parent"
@ -10,14 +9,21 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="5">
<include layout = "@layout/content_user"/>
</LinearLayout>-->
android:layout_height="30dp">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="欢迎来到橙子乐园"
android:textColor="#95C958"
android:textSize="20dp"/>
<!-- <include layout="@layout/content_user" />-->
</LinearLayout>
<FrameLayout
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_height="match_parent"
android:layout_weight="1"/>
<LinearLayout
android:layout_width="match_parent"

@ -6,95 +6,56 @@
android:layout_height="match_parent">
<SearchView
android:id="@+id/searchView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:background="@drawable/index_menu"
android:focusable="true"
android:queryHint="请输入搜索内容"
android:iconifiedByDefault="false"
android:queryHint="请输入搜索内容" />
android:focusable="false"
android:id="@+id/searchView"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:layout_marginTop="20dp"
android:layout_marginRight="1dp"
android:background="@drawable/index_menu"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/chucheng"
android:layout_width="0dp"
android:layout_height="150dp"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="100dp"
android:src="@drawable/chucheng"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="褚橙"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/bingtangcheng"
android:layout_width="0dp"
android:layout_height="150dp"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="100dp"
android:src="@drawable/bingtangcheng" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="冰糖橙"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout android:layout_height="wrap_content" android:layout_width="match_parent" android:background="@drawable/index_menu" android:orientation="vertical" android:layout_marginRight="1dp" android:layout_marginTop="20dp" android:layout_marginLeft="1dp">
<LinearLayout android:layout_height="wrap_content" android:layout_width="match_parent" android:orientation="horizontal" android:layout_marginTop="5dp">
<LinearLayout android:layout_height="150dp" android:layout_width="0dp" android:orientation="vertical" android:id="@+id/chucheng" android:gravity="center" android:layout_weight="1">
<ImageView android:layout_height="100dp" android:layout_width="wrap_content" android:src="@drawable/chucheng"/>
<TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_marginTop="5dp" android:textSize="20sp" android:textColor="#696969" android:text="褚橙"/>
<LinearLayout
android:id="@+id/qicheng"
android:layout_width="0dp"
android:layout_height="150dp"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="100dp"
android:src="@drawable/qicheng" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="脐橙"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
-<LinearLayout
android:layout_height="150dp"
android:layout_width="0dp"
android:orientation="vertical"
android:id="@+id/bingtangcheng"
android:gravity="center"
android:layout_weight="1">
<ImageView
android:layout_height="100dp"
android:layout_width="wrap_content"
android:src="@drawable/bingtangcheng"/>
<TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_marginTop="5dp" android:textSize="20sp" android:textColor="#696969" android:text="冰糖橙"/>
</LinearLayout>
-<LinearLayout android:layout_height="150dp" android:layout_width="0dp" android:orientation="vertical" android:id="@+id/qicheng" android:gravity="center" android:layout_weight="1">
<ImageView android:layout_height="100dp" android:layout_width="wrap_content" android:src="@drawable/qicheng"/>
<TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_marginTop="5dp" android:textSize="20sp" android:textColor="#696969" android:text="脐橙"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>

Loading…
Cancel
Save