소스 검색

Click behaviour and Navigation

master
Flo Smilari 3 년 전
부모
커밋
0fddf1f1c8

BIN
.gradle/7.3.3/executionHistory/executionHistory.bin 파일 보기


BIN
.gradle/7.3.3/executionHistory/executionHistory.lock 파일 보기


BIN
.gradle/7.3.3/fileHashes/fileHashes.bin 파일 보기


BIN
.gradle/7.3.3/fileHashes/fileHashes.lock 파일 보기


BIN
.gradle/7.3.3/fileHashes/resourceHashesCache.bin 파일 보기


BIN
.gradle/buildOutputCleanup/buildOutputCleanup.lock 파일 보기


+ 6
- 0
.idea/vcs.xml 파일 보기

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="svn" />
</component>
</project>

+ 66
- 6
.idea/workspace.xml 파일 보기

<option name="autoReloadType" value="NONE" /> <option name="autoReloadType" value="NONE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="41369230-c648-4299-baf3-de5f13bcb18c" name="Changes" comment="" />
<list default="true" id="41369230-c648-4299-baf3-de5f13bcb18c" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/7.3.3/executionHistory/executionHistory.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.3.3/executionHistory/executionHistory.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/7.3.3/executionHistory/executionHistory.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.3.3/executionHistory/executionHistory.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/7.3.3/fileHashes/fileHashes.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.3.3/fileHashes/fileHashes.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/7.3.3/fileHashes/fileHashes.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.3.3/fileHashes/fileHashes.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/7.3.3/fileHashes/resourceHashesCache.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.3.3/fileHashes/resourceHashesCache.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/buildOutputCleanup/buildOutputCleanup.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/buildOutputCleanup/buildOutputCleanup.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/model/ArcherySetup.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/model/ArcherySetup.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/model/IArcherySetup.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/model/IArcherySetup.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightFragment.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightFragment.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightViewModel.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightViewModel.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/equipment/EquipmentRecyclerViewAdapter.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/equipment/EquipmentRecyclerViewAdapter.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/fragment_equipment_choose.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/fragment_equipment_choose.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/values-de/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values-de/strings.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/values/dimens.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values/dimens.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<property name="RunOnceActivity.cidr.known.project.marker" value="true" /> <property name="RunOnceActivity.cidr.known.project.marker" value="true" />
<property name="android-custom-viewC:/Users/FSmilari/.gradle/caches/modules-2/files-2.1/androidx.recyclerview/recyclerview/1.2.1/f0f93e67af3f7417bdd560d5142f6dec4fe629c3/recyclerview-1.2.1-sources.jar!/androidx/recyclerview/widget/RecyclerView.java_RecyclerView_DIMENSIONS" value="1080&#10;1920" /> <property name="android-custom-viewC:/Users/FSmilari/.gradle/caches/modules-2/files-2.1/androidx.recyclerview/recyclerview/1.2.1/f0f93e67af3f7417bdd560d5142f6dec4fe629c3/recyclerview-1.2.1-sources.jar!/androidx/recyclerview/widget/RecyclerView.java_RecyclerView_DIMENSIONS" value="1080&#10;1920" />
<property name="android-custom-viewC:/Users/FSmilari/.gradle/caches/modules-2/files-2.1/androidx.recyclerview/recyclerview/1.2.1/f0f93e67af3f7417bdd560d5142f6dec4fe629c3/recyclerview-1.2.1-sources.jar!/androidx/recyclerview/widget/RecyclerView.java_SELECTED" value="RecyclerView" /> <property name="android-custom-viewC:/Users/FSmilari/.gradle/caches/modules-2/files-2.1/androidx.recyclerview/recyclerview/1.2.1/f0f93e67af3f7417bdd560d5142f6dec4fe629c3/recyclerview-1.2.1-sources.jar!/androidx/recyclerview/widget/RecyclerView.java_SELECTED" value="RecyclerView" />
<property name="android-custom-viewC:/Users/FSmilari/AppData/Local/Android/Sdk/sources/android-32/android/view/View.java_SELECTED" value="View" />
<property name="android-custom-viewC:/Users/FSmilari/AppData/Local/Android/Sdk/sources/android-32/android/view/View.java_View_DIMENSIONS" value="1080&#10;1920" />
<property name="android-custom-viewC:/Users/FSmilari/AppData/Local/Android/Sdk/sources/android-32/android/view/ViewGroup.java_SELECTED" value="ViewGroup" />
<property name="android-custom-viewC:/Users/FSmilari/AppData/Local/Android/Sdk/sources/android-32/android/view/ViewGroup.java_ViewGroup_DIMENSIONS" value="1080&#10;1920" />
<property name="cidr.known.project.marker" value="true" /> <property name="cidr.known.project.marker" value="true" />
<property name="code.cleanup.on.save" value="true" /> <property name="code.cleanup.on.save" value="true" />
<property name="format.on.save" value="true" /> <property name="format.on.save" value="true" />
</configuration> </configuration>
</component> </component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" /> <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="SvnConfiguration" cleanupOnStartRun="true">
<configuration>C:\Users\FSmilari\AppData\Roaming\Subversion</configuration>
<supportedVersion>125</supportedVersion>
</component>
<component name="SvnFileUrlMappingImpl">
<option name="myMappingRoots">
<list>
<SvnCopyRootSimple>
<option name="myVcsRoot" value="Z:\Work\Java Projects\Android\RecurveBowSight\V2" />
<option name="myCopyRoot" value="Z:\Work\Java Projects\Android\RecurveBowSight\V2" />
</SvnCopyRootSimple>
</list>
</option>
<option name="myMoreRealMappingRoots">
<list>
<SvnCopyRootSimple>
<option name="myVcsRoot" value="Z:\Work\Java Projects\Android\RecurveBowSight\V2" />
<option name="myCopyRoot" value="Z:\Work\Java Projects\Android\RecurveBowSight\V2" />
</SvnCopyRootSimple>
</list>
</option>
</component>
<component name="TaskManager"> <component name="TaskManager">
<task active="true" id="Default" summary="Default task"> <task active="true" id="Default" summary="Default task">
<changelist id="41369230-c648-4299-baf3-de5f13bcb18c" name="Changes" comment="" /> <changelist id="41369230-c648-4299-baf3-de5f13bcb18c" name="Changes" comment="" />
<line>19</line> <line>19</line>
<option name="timeStamp" value="2" /> <option name="timeStamp" value="2" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="java-line">
<url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/RBSMainActivity.java</url>
<line>50</line>
<option name="timeStamp" value="3" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="java-line"> <line-breakpoint enabled="true" suspend="THREAD" type="java-line">
<url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/database/RBSDatabaseHelper.java</url> <url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/database/RBSDatabaseHelper.java</url>
<line>99</line> <line>99</line>
<option name="timeStamp" value="4" /> <option name="timeStamp" value="4" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="java-line">
<url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/equipment/EquipmentRecyclerViewAdapter.java</url>
<line>73</line>
<option name="timeStamp" value="6" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="java-line">
<url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightFragment.java</url>
<line>25</line>
<option name="timeStamp" value="8" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="java-line">
<url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightViewModel.java</url>
<line>26</line>
<option name="timeStamp" value="9" />
</line-breakpoint>
</breakpoints> </breakpoints>
</breakpoint-manager> </breakpoint-manager>
<watches-manager>
<configuration name="app">
<watch expression="getArguments()" />
<watch expression="this.selectedArcherySetup.getName()" language="JAVA" />
</configuration>
</watches-manager>
</component> </component>
</project> </project>

+ 11
- 0
app/src/main/java/ch/spherIC/recurvebowsight/model/ArcherySetup.java 파일 보기

*/ */
package ch.spherIC.recurvebowsight.model; package ch.spherIC.recurvebowsight.model;
import android.os.Parcel;
/** /**
* @author F. Smilari * @author F. Smilari
*/ */
public void setBraceHeight(final Double braceHeight) { public void setBraceHeight(final Double braceHeight) {
this.braceHeight = braceHeight; this.braceHeight = braceHeight;
} }
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
}
} }

+ 3
- 1
app/src/main/java/ch/spherIC/recurvebowsight/model/IArcherySetup.java 파일 보기

*/ */
package ch.spherIC.recurvebowsight.model; package ch.spherIC.recurvebowsight.model;
import android.os.Parcelable;
/** /**
* @author F. Smilari * @author F. Smilari
*/ */
public interface IArcherySetup extends IEntity {
public interface IArcherySetup extends IEntity, Parcelable {
ISight getSight(); ISight getSight();

+ 6
- 0
app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightFragment.java 파일 보기

import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import ch.spherIC.recurvebowsight.databinding.FragmentCalcsightBinding; import ch.spherIC.recurvebowsight.databinding.FragmentCalcsightBinding;
import ch.spherIC.recurvebowsight.model.IArcherySetup;


public class CalculateSightFragment extends Fragment { public class CalculateSightFragment extends Fragment {


binding = FragmentCalcsightBinding.inflate(inflater, container, false); binding = FragmentCalcsightBinding.inflate(inflater, container, false);
View root = binding.getRoot(); View root = binding.getRoot();


if (getArguments() != null && getArguments().containsKey("setup")) {
IArcherySetup archerySetup = getArguments().getParcelable("setup");
galleryViewModel.setSelectedArcherySetup(archerySetup);
}

final TextView textView = binding.textCalcsight; final TextView textView = binding.textCalcsight;
galleryViewModel.getText().observe(getViewLifecycleOwner(), textView::setText); galleryViewModel.getText().observe(getViewLifecycleOwner(), textView::setText);
return root; return root;

+ 17
- 1
app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightViewModel.java 파일 보기

package ch.spherIC.recurvebowsight.ui.calcsight; package ch.spherIC.recurvebowsight.ui.calcsight;


import android.text.TextUtils;

import androidx.lifecycle.LiveData; import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel; import androidx.lifecycle.ViewModel;
import ch.spherIC.recurvebowsight.model.IArcherySetup;


public class CalculateSightViewModel extends ViewModel { public class CalculateSightViewModel extends ViewModel {


private final MutableLiveData<String> mText; private final MutableLiveData<String> mText;


private IArcherySetup selectedArcherySetup;

public CalculateSightViewModel() { public CalculateSightViewModel() {
mText = new MutableLiveData<>(); mText = new MutableLiveData<>();
mText.setValue("This is the \"Calc Sight\" fragment");
mText.setValue("This is the \"Calc Sight\" fragment for: \n-");
}

public IArcherySetup getSelectedArcherySetup() {
return selectedArcherySetup;
} }


public void setSelectedArcherySetup(IArcherySetup selectedArcherySetup) {
this.selectedArcherySetup = selectedArcherySetup;
String setupName = (this.selectedArcherySetup != null && !TextUtils.isEmpty(this.selectedArcherySetup.getName())) ? this.selectedArcherySetup.getName() : "-";
mText.setValue("This is the \"Calc Sight\" fragment for: \n" + setupName);
}


public LiveData<String> getText() { public LiveData<String> getText() {
return mText; return mText;
} }

+ 41
- 0
app/src/main/java/ch/spherIC/recurvebowsight/ui/equipment/EquipmentRecyclerViewAdapter.java 파일 보기

package ch.spherIC.recurvebowsight.ui.equipment; package ch.spherIC.recurvebowsight.ui.equipment;


import android.content.Context; import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;


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


import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.navigation.Navigation;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import ch.spherIC.recurvebowsight.R; import ch.spherIC.recurvebowsight.R;
import ch.spherIC.recurvebowsight.databinding.FragmentEquipmentChooseBinding; import ch.spherIC.recurvebowsight.databinding.FragmentEquipmentChooseBinding;
holder.mSetupNameView.setText(getSetupName(archerySetup)); holder.mSetupNameView.setText(getSetupName(archerySetup));
holder.mRiserNameView.setText(getRiserName(archerySetup)); holder.mRiserNameView.setText(getRiserName(archerySetup));
holder.mSightNameView.setText(getSightName(archerySetup)); holder.mSightNameView.setText(getSightName(archerySetup));

holder.itemView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
float alpha = 1.0f;
int horzMargin = v.getResources().getDimensionPixelSize(R.dimen.activity_horizontal_margin);
int vertMargin = v.getResources().getDimensionPixelSize(R.dimen.activity_vertical_margin);
if (event.getAction() == MotionEvent.ACTION_DOWN) {
alpha = 0.5f;
horzMargin = v.getResources().getDimensionPixelSize(R.dimen.activity_horizontal_margin_onclick);
vertMargin = v.getResources().getDimensionPixelSize(R.dimen.activity_vertical_margin_onclick);
}
View setupCardView = ((ConstraintLayout) v).findViewById(R.id.card_view_setup);
setupCardView.setAlpha(alpha);

setupCardView = ((ConstraintLayout) v).findViewById(R.id.card_view_border);
ConstraintLayout.LayoutParams layoutParams = (ConstraintLayout.LayoutParams) setupCardView.getLayoutParams();
layoutParams.setMargins(horzMargin, vertMargin, horzMargin, vertMargin);
setupCardView.requestLayout();
return false;
}
});

holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(EquipmentRecyclerViewAdapter.this.context,
context.getString(R.string.caption_setup_choosen) + holder.archerySetup,
Toast.LENGTH_SHORT).show();

Bundle bundle = new Bundle();
bundle.putParcelable("setup", holder.archerySetup);
Navigation.findNavController(v).navigate(R.id.nav_calcsight, bundle);
}
});
} }


private String getSetupName(IArcherySetup archerySetup) { private String getSetupName(IArcherySetup archerySetup) {

+ 9
- 6
app/src/main/res/layout/fragment_equipment_choose.xml 파일 보기

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="144dp"
android:orientation="horizontal"> android:orientation="horizontal">


<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/card_view_border" android:id="@+id/card_view_border"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="@dimen/text_margin"
android:layout_marginBottom="@dimen/activity_horizontal_margin"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="@dimen/activity_horizontal_margin"
android:backgroundTint="#54AAD1" android:backgroundTint="#54AAD1"
app:cardCornerRadius="20dp" app:cardCornerRadius="20dp"
app:cardElevation="10dp" app:cardElevation="10dp"


<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/setup_image_view" android:id="@+id/setup_image_view"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp" android:layout_marginBottom="20dp"
android:layout_marginStart="20dp" android:layout_marginStart="20dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"


<ImageView <ImageView
android:id="@+id/setup_image" android:id="@+id/setup_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="64dp"
android:layout_height="64dp"
android:background="@drawable/side_nav_bar" android:background="@drawable/side_nav_bar"
android:contentDescription="@string/menu_equipment" android:contentDescription="@string/menu_equipment"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"

+ 1
- 0
app/src/main/res/values-de/strings.xml 파일 보기

<string name="menu_equipment_choose">Ausrüstung wählen</string> <string name="menu_equipment_choose">Ausrüstung wählen</string>
<string name="menu_calculate_sight">Visiereinstellung berechnen</string> <string name="menu_calculate_sight">Visiereinstellung berechnen</string>
<string name="caption_NoSelection">Keine Auswahl...</string> <string name="caption_NoSelection">Keine Auswahl...</string>
<string name="caption_setup_choosen">"Gewählte Ausrüstung: "</string>
</resources> </resources>

+ 2
- 0
app/src/main/res/values/dimens.xml 파일 보기

<!-- Default screen margins, per the Android Design guidelines. --> <!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen> <dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen> <dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="activity_horizontal_margin_onclick">18dp</dimen>
<dimen name="activity_vertical_margin_onclick">18dp</dimen>
<dimen name="nav_header_vertical_spacing">8dp</dimen> <dimen name="nav_header_vertical_spacing">8dp</dimen>
<dimen name="nav_header_height">176dp</dimen> <dimen name="nav_header_height">176dp</dimen>
<dimen name="fab_margin">16dp</dimen> <dimen name="fab_margin">16dp</dimen>

+ 1
- 0
app/src/main/res/values/strings.xml 파일 보기

<string name="menu_equipment_choose">Choose Equipment</string> <string name="menu_equipment_choose">Choose Equipment</string>
<string name="menu_calculate_sight">Calculate Sight</string> <string name="menu_calculate_sight">Calculate Sight</string>
<string name="caption_NoSelection">No Selection...</string> <string name="caption_NoSelection">No Selection...</string>
<string name="caption_setup_choosen">"Selected Setup: "</string>
<!-- TODO: Remove or change this placeholder text --> <!-- TODO: Remove or change this placeholder text -->
</resources> </resources>

Loading…
취소
저장