Skip to content

Commit

Permalink
测试题库,以及旋转保存功能
Browse files Browse the repository at this point in the history
  • Loading branch information
v200123 committed Jun 30, 2018
1 parent a52d338 commit b55cf66
Show file tree
Hide file tree
Showing 19 changed files with 171 additions and 20 deletions.
Binary file modified .gradle/4.4/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/4.4/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/4.4/javaCompile/classAnalysis.bin
Binary file not shown.
Binary file modified .gradle/4.4/javaCompile/javaCompile.lock
Binary file not shown.
Binary file modified .gradle/4.4/javaCompile/taskHistory.bin
Binary file not shown.
Binary file modified .gradle/4.4/javaCompile/taskJars.bin
Binary file not shown.
Binary file modified .gradle/4.4/taskHistory/taskHistory.bin
Binary file not shown.
Binary file modified .gradle/4.4/taskHistory/taskHistory.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
43 changes: 26 additions & 17 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,49 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
<activity
android:name=".MainLogin"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
<!--<intent-filter>-->
<!--&lt;!&ndash;<action android:name="android.intent.action.MAIN" />&ndash;&gt;-->
<!--&lt;!&ndash;<category android:name="android.intent.category.LAUNCHER" />&ndash;&gt;-->
<!--</intent-filter>-->
</activity>
<service
android:name=".MyService"
android:enabled="true">
</service>
<activity
</service>
<activity
android:name=".another_view.Another_Activity_Main"
android:theme="@style/Theme.AppCompat.DayNight.DarkActionBar"
>
</activity>
<activity
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".another_view.Text_Brain">
</activity>
<activity
</activity>
<activity
android:name=".MainActivity">
</activity>
</activity>
<activity android:name=".View_List">
</activity>
<activity
</activity>
<activity
android:name=".load.LearnLoad">
</activity>
</activity>
<activity
android:name=".Thread_Test">
</activity>
<activity
android:name=".Test_Service">
</activity>
<activity android:name=".another_view.CriminalIntent">
</activity>
<activity android:name=".another_view.CrimeList">
</activity>

</application>

</manifest>
3 changes: 1 addition & 2 deletions app/src/main/java/com/example/lc/broadcast/FruitAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@

import com.bumptech.glide.Glide;

import java.util.ArrayList;
import java.util.List;

public class FruitAdapter extends RecyclerView.Adapter<FruitAdapter.ViewHolder> {
public FruitAdapter(List<Fruit> fruitList) {
this.fruitList = fruitList;
}

private List<Fruit> fruitList = new ArrayList<>();
private List<Fruit> fruitList ;
private Context mContext;
@NonNull
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.another_main_activity);
findViewById(R.id.TextBrian).setOnClickListener(this);
findViewById(R.id.Criminallntent).setOnClickListener(this);
}


Expand All @@ -24,6 +25,11 @@ public void onClick(View v) {
case R.id.TextBrian :
Intent i = new Intent(Another_Activity_Main.this,Text_Brain.class);
startActivity(i);
break;
case R.id.Criminallntent :
Intent i1= new Intent(Another_Activity_Main.this,CrimeList.class);
startActivity(i1);
break;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package com.example.lc.broadcast.another_view;


import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;

import com.example.lc.broadcast.R;

/**
* 这个是Crime_Flagment的Fragment的程序
*/
public class Crime_Flagment extends Fragment {
private Crime mCrime;
private EditText CrimeText;
private Button btn_Date;
private CheckBox mCheckBox;

@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.crime_fragment,container,false);
mCrime =new Crime();
CrimeText = v.findViewById(R.id.CrimeInformation);
btn_Date = v.findViewById(R.id.Date);
mCheckBox = v.findViewById(R.id.Crime_CheckBox);
CrimeText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}

@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {

}

@Override
public void afterTextChanged(Editable s) {
mCrime.setTitle(s.toString());
}
});
btn_Date.setText(mCrime.getDate());
btn_Date.setEnabled(false);
mCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mCrime.setSolved(isChecked);
}
});
return v;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.example.lc.broadcast.another_view;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;

import com.example.lc.broadcast.R;

public abstract class SingleFragment extends AppCompatActivity {
protected abstract Fragment createFragment();

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_crime);

FragmentManager fm = getSupportFragmentManager();
Fragment fragment = fm.findFragmentById(R.id.Fragment_contain);
if(fragment==null)
{
fragment = createFragment();
fm.beginTransaction()
.add(R.id.Fragment_contain,fragment)
.commit();
}

}
}
11 changes: 11 additions & 0 deletions app/src/main/res/layout/activity_crime.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/Fragment_contain"
android:layout_width="match_parent"
android:layout_height="match_parent">




</FrameLayout>
3 changes: 2 additions & 1 deletion app/src/main/res/layout/another_main_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
android:layout_height="wrap_content"
android:text="@string/TextBrian"/>
<Button

android:id="@+id/Criminallntent"
android:text="跳转到记录犯罪信息"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

Expand Down
32 changes: 32 additions & 0 deletions app/src/main/res/layout/crime_fragment.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
style="?android:listSeparatorTextViewStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/title"/>
<EditText
android:id="@+id/CrimeInformation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="输入犯错的信息"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="DETAILS"/>
<Button
android:id="@+id/Date"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/Crime_CheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
style="?android:listSeparatorTextViewStyle"
android:text="解决了么"/>
</LinearLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
<string name="TextBrian">测试你的智商</string>
<string name="Right">正确</string>
<string name="Wrong">错误</string>
<string name="title">TITLE</string>
</resources>

0 comments on commit b55cf66

Please sign in to comment.