Merge remote-tracking branch 'origin/master'

Conflicts:
	app/app.iml
	app/src/main/res/values/strings.xml
This commit is contained in:
Christopher Beckmann 2016-02-18 14:47:05 +01:00
commit 5d9863bdee
13 changed files with 126 additions and 25 deletions

View file

@ -68,19 +68,28 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/debug" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/mockable-android-23.jar" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />

View file

@ -1,5 +1,6 @@
package org.secuso.privacyfriendlysudoku.ui;
import android.app.Dialog;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.PorterDuff;
@ -45,6 +46,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
RatingBar difficultyBar;
TextView difficultyText;
SharedPreferences settings;
ImageView arrowLeft, arrowRight;
/**
* The {@link ViewPager} that will host the section contents.
@ -88,7 +90,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
may be best to switch to a
{@link android.support.v4.app.FragmentStatePagerAdapter}.
*/
SectionsPagerAdapter mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
final SectionsPagerAdapter mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
@ -100,6 +102,31 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
String lastChosenGameType = settings.getString("lastChosenGameType", GameType.Default_9x9.name());
int index = validGameTypes.indexOf(Enum.valueOf(GameType.class, lastChosenGameType));
mViewPager.setCurrentItem(index);
arrowLeft = (ImageView)findViewById(R.id.arrow_left);
arrowRight = (ImageView) findViewById(R.id.arrow_right);
//care for initial postiton of the ViewPager
arrowLeft.setVisibility((index==0)?View.INVISIBLE:View.VISIBLE);
arrowRight.setVisibility((index==mSectionsPagerAdapter.getCount()-1)?View.INVISIBLE:View.VISIBLE);
//Update ViewPager on change
mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
arrowLeft.setVisibility((position==0)?View.INVISIBLE:View.VISIBLE);
arrowRight.setVisibility((position==mSectionsPagerAdapter.getCount()-1)?View.INVISIBLE:View.VISIBLE);
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
// Set the difficulty Slider to whatever was chosen the last time
difficultyBar = (RatingBar)findViewById(R.id.difficultyBar);
@ -116,7 +143,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
difficultyText.setText(getString(difficultyList.get((int) ratingBar.getRating() - 1).getStringResID()));
}
});
GameDifficulty lastChosenDifficulty = GameDifficulty.valueOf(settings.getString("lastChosenDifficulty", "Easy"));
GameDifficulty lastChosenDifficulty = GameDifficulty.valueOf(settings.getString("lastChosenDifficulty", "Moderate"));
difficultyBar.setRating(GameDifficulty.getValidDifficultyList().indexOf(lastChosenDifficulty) + 1);
/*LayerDrawable stars = (LayerDrawable)difficultyBar.getProgressDrawable();
stars.getDrawable(2).setColorFilter(getResources().getColor(R.color.colorPrimary), PorterDuff.Mode.SRC_ATOP);//Color for Stars fully selected
@ -149,6 +176,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
}
public void onClick(View view) {
Intent i = null;
@ -280,6 +308,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
super(fm);
}
@Override
public Fragment getItem(int position) {
// getItem is called to instantiate the fragment for the given page.
@ -287,6 +316,8 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
return GameTypeFragment.newInstance(position);
}
@Override
public int getCount() {
// Show 3 total pages.
@ -294,6 +325,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
}
}
/**
* A placeholder fragment containing a simple view.
*/
@ -302,6 +334,8 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
* The fragment argument representing the section number for this
* fragment.
*/
private static final String ARG_SECTION_NUMBER = "section_number";
/**
@ -317,8 +351,10 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
}
public GameTypeFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {

View file

@ -94,7 +94,7 @@ public class SudokuCellView extends View {
p.setColor(Color.WHITE);
break;
case Error:
p.setColor(Color.RED);
p.setColor(Color.LTGRAY);
break;
case Selected:
p.setColor(Color.GREEN);

View file

@ -211,22 +211,29 @@ public class SudokuFieldLayout extends RelativeLayout implements IHighlightChang
p.setStrokeWidth(4);
p.setColor(Color.RED);
float offset1=0;
float offset2= 0;
int row;
int col;
int row2;
int col2;
float radius;
for(CellConflict conflict : gameController.getErrorList()) {
//gamecells[conflict.getRowCell1()][conflict.getColCell1()].
int row = conflict.getRowCell1();
int col = conflict.getColCell1();
canvas.drawCircle(gameCellWidth * col + gameCellWidth / 2, gameCellHeight * row + gameCellHeight / 2, gameCellWidth/2 - gameCellWidth / 8, p);
row = conflict.getRowCell1();
col = conflict.getColCell1();
radius = gameCellWidth/2 - gameCellWidth / 8;
canvas.drawCircle(gameCellWidth * col + gameCellWidth / 2, gameCellHeight * row + gameCellHeight / 2, radius, p);
row2 = conflict.getRowCell2();
col2 = conflict.getColCell2();
canvas.drawCircle(gameCellWidth * col2 + gameCellWidth / 2, gameCellHeight * row2 + gameCellHeight / 2, radius, p);
int row2 = conflict.getRowCell2();
int col2 = conflict.getColCell2();
canvas.drawCircle(gameCellWidth * col2 + gameCellWidth / 2, gameCellHeight * row2 + gameCellHeight / 2, gameCellWidth / 2 - gameCellWidth / 8, p);
float offset1=0;
float offset2= 0;
float radius = gameCellWidth/2 - gameCellWidth / 8;
if (col == col2 || row == row2) {
offset1 = (col > col2)? 0-radius:radius;
offset2 = (row > row2)? 0-radius:radius;

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<bitmap
android:src="@drawable/ic_star_black_48dp"
android:tint="@color/middlegrey" />
</item>
<item android:id="@android:id/secondaryProgress">
<bitmap
android:src="@drawable/ic_star_half_black_48dp"
android:tint="@color/middlegrey" />
</item>
<item android:id="@android:id/progress">
<bitmap
android:src="@drawable/ic_star_black_48dp"
android:tint="@color/colorAccent" />
</item>
</layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -17,8 +17,7 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<bitmap
android:src="@drawable/ic_star_black_48dp"
android:tint="@color/middlegrey" />
android:src="@drawable/ic_star_grey_48dp"/>
</item>
<item android:id="@android:id/secondaryProgress">
<bitmap
@ -27,8 +26,7 @@
</item>
<item android:id="@android:id/progress">
<bitmap
android:src="@drawable/ic_star_black_48dp"
android:tint="@color/colorAccent" />
android:src="@drawable/ic_star_blue_48dp" />
</item>
</layer-list>

View file

@ -147,12 +147,12 @@
android:clickable="false"
android:background="@drawable/standalone_button"/>
<Button
<!-- <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Win Debug"
android:visibility="invisible"
android:onClick="callFragment"/>
android:text="coachMark"
android:visibility="visible"
android:onClick="coachMark"/> -->
<!--
<LinearLayout
android:layout_width="match_parent"

View file

@ -6,12 +6,13 @@
android:layout_gravity="center">
<LinearLayout
android:layout_width="250dp" android:layout_height="250dp"
android:background="@drawable/ic_trophy_black_48dp"
android:layout_width="275sp" android:layout_height="275sp"
android:weightSum="5"
android:background="@drawable/ic_trophy_black_48dp"
android:orientation="horizontal"
android:layout_gravity="center">
<LinearLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
@ -50,7 +51,9 @@
android:layout_weight="4"
android:layout_marginTop="46dp"
android:layout_gravity="center_horizontal"
android:orientation="vertical">
android:orientation="vertical"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View file

@ -24,7 +24,7 @@
<string name="help_notes">Remarques</string>
<string name="help_notes_summary">Change si les numeros se montre étant des valeurs ou des remarques sur le champs</string>
<string name="help_permissions">Droits</string>
<string name="help_permissions_summary">Privacy Friendly Sudonku n\'utilise pas d\'autorisations.</string>
<string name="help_permissions_summary">Privacy Friendly Sudoku n\'utilise pas d\'autorisations.</string>
<string name="help_privacyInfo">Information de confidentialité</string>
<string name="help_undo">Défaire</string>
<string name="help_undo_summary">Défais la dernière action</string>

View file

@ -126,5 +126,5 @@
<string name="help_notes_summary">Toggles if numbers should be set as notes or as values in a field</string>
<string name="help_privacyInfo">Privacy Info</string>
<string name="help_permissions">Permissions</string>
<string name="help_permissions_summary">Privacy Friendly Sudonku does not use any permissions.</string>
<string name="help_permissions_summary">Privacy Friendly Sudoku does not use any permissions.</string>
</resources>

View file

@ -29,6 +29,20 @@
<item name="android:windowSoftInputMode">adjustPan|stateUnspecified</item>
</style>
<style name="CoachMark">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@color/transparent</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">false</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:windowSoftInputMode">adjustPan|stateUnspecified</item>
</style>
<style name="RatingBarStyle" parent="@android:style/Widget.RatingBar">
<item name="android:progressDrawable">@drawable/ratingbar</item>