Skip to content

Commit

Permalink
Merge pull request #18 from jcarolus/develop
Browse files Browse the repository at this point in the history
version 8.5.0
  • Loading branch information
jcarolus committed May 2, 2015
2 parents 83583be + 4408277 commit 08f4a3a
Show file tree
Hide file tree
Showing 70 changed files with 2,971 additions and 2,306 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# Generated files
bin/
gen/
native/project/obj/

# Gradle files
.gradle/
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ android-chess
Chess game for Android.


Roadmap
- add an "ECO" button to explore and choose an opening from the ECO opening database
- improve FICS client
- TV sync. Chrome-cast, Samsung convergence, DIAL, etc.
- TV screen using DIAL; see https://github.com/jcarolus/chess-tv-screen
- new high-res piece-sets
- layout improvements for tablets in landscape mode
- take items from the feature-request list
- translation to other languages (starting with Italian)
- add an "ECO" button to explore and choose an opening from the ECO opening database
- tournament / competition
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="jwtc.android.chess"
android:versionCode="116"
android:versionName="8.4.4"
android:versionCode="117"
android:versionName="8.5.0"
android:installLocation="auto"
>
<application android:icon="@drawable/icon" android:label="@string/app_name"
Expand Down
65 changes: 55 additions & 10 deletions app/src/main/java/jwtc/android/chess/ChessViewBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
import android.content.res.AssetManager;
import android.content.res.Configuration;
import android.graphics.BitmapFactory;
import android.graphics.Rect;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Display;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.View.*;
import android.widget.RelativeLayout;
Expand Down Expand Up @@ -229,30 +231,73 @@ public void OnResume(){
ChessImageView._matrix = null;

//Log.i("ChessViewBase", "layout width " + _mainLayout.getHeight());


Window window = _activity.getWindow();
final View v = window.getDecorView();
v.post(new Runnable() {
@Override
public void run() {
Rect rectangle= new Rect();
v.getWindowVisibleDisplayFrame(rectangle);
int availableHeight = rectangle.bottom - rectangle.top;
int availableWidth = rectangle.right - rectangle.left;
int length;

if(availableHeight > availableWidth){
length = availableWidth / 8;
} else {
length = availableHeight / 8;
}
//int contentViewTop = window.findViewById(Window.ID_ANDROID_CONTENT).getTop();
//int titleBarHeight= contentViewTop - statusBarHeight;

Log.i("ChessViewBase", "availableHeight 2 " + availableHeight);

LayoutParams params = new LayoutParams(length, length);
for(int i = 0; i < 64; i++){
_arrImages[i].setLayoutParams(params);
}
}
});
/*
Rect rectangle= new Rect();
v.getWindowVisibleDisplayFrame(rectangle);
int availableHeight = rectangle.bottom - rectangle.top;
//int contentViewTop = window.findViewById(Window.ID_ANDROID_CONTENT).getTop();
//int titleBarHeight= contentViewTop - statusBarHeight;
Log.i("ChessViewBase", "availableHeight " + availableHeight);
Display display = ((WindowManager) _activity.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
DisplayMetrics metrics = new DisplayMetrics();
display.getMetrics(metrics);
// get smallest length of screen
int length = display.getWidth();

int length;
// @TODO - res/values-sw600dp and res/values-xlarge - or values-large
if(_activity.getResources().getBoolean(R.bool.portraitOnly)){
Log.i("ChessViewBase", "portrait Only");
}
if(_activity.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT){
//if(length > display.getHeight()){
length /= 8;
//length = display.getWidth() / 8;
length = availableHeight / 8;
//length = _activity.getWindow().getDecorView().getWidth() / 8;
Log.i("ChessViewBase", "Portrait " + length);
} else {
//DENSITY_LOW, DENSITY_MEDIUM, or DENSITY_HIGH.
//metrics.density + ", " + metrics.widthPixels + "px @ " + metrics.densityDpi
//Log.i("ChessViewBase", "::" + length + "::" + metrics.widthPixels + " density:" + metrics.density + " @ " + metrics.densityDpi);
//length = display.getHeight() / 9;
return;
//length = display.getHeight() / 8;
length = availableHeight / 8;
//length = _activity.getWindow().getDecorView().getHeight() / 8;
//return;
}
LayoutParams params = new LayoutParams(length, length);
for(int i = 0; i < 64; i++){
_arrImages[i].setLayoutParams(params);
}
*/

}

public void setBlindfoldMode(int mode){
Expand Down
258 changes: 0 additions & 258 deletions app/src/main/java/jwtc/android/chess/convergence/Connection.java

This file was deleted.

Loading

0 comments on commit 08f4a3a

Please sign in to comment.