Skip to content

Commit

Permalink
more rework on toolbar and menu options
Browse files Browse the repository at this point in the history
 - toolbar button configurations added to option menu
 - refactoring
 - metadata (fastlane) updated
  • Loading branch information
lufebe16 committed Sep 21, 2023
1 parent 158c313 commit ae9aa78
Show file tree
Hide file tree
Showing 11 changed files with 194 additions and 93 deletions.
10 changes: 7 additions & 3 deletions README.android
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ Cardsets:

LB230301.

(After new changes as of 27.3.23 - not contained in the last f-droid
version):

Allow external storage access for Android 10 and later.

- on Android 10 it ist still possible to write to the extenal storage. A
Expand All @@ -83,3 +80,10 @@ LB230301.
never query you for that. You may do it on your own.

LB230327.

Scheduled for the next Android release:
- Screen rotation lock.
- Toolbar actualised
- Protection from accidental reset or redeal.

LB230919.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ mkdir -p "$PKGTREE"

### Alternate toolkit.

- Kivy (10.0 or later)
- Kivy
- Features:
- Sound support integrated.
- Android apk build support.
Expand All @@ -189,7 +189,11 @@ On the basis of Kivy an Android App is also available. You may build
your own using appropriate build instructions in README.android and
in Directory buildozer.

Some versions will also be published on F-droid (https://f-droid.org)
Some versions will also be published on F-droid.

[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
alt="Get it on F-Droid"
height="80">](https://f-droid.org/packages/org.lufebe16.pysolfc/)


### Configuring Freecell Solver
Expand Down
4 changes: 4 additions & 0 deletions android/NOTE
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ Please use the new setup presented in directory
buildozer.

LB221118.

This Directory will soon be deleted from the Repo.

LB230919.
4 changes: 2 additions & 2 deletions buildozer/pubspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 102122001,
"versionName": "2.20.1",
"versionCode": 102122100,
"versionName": "2.21.0",
"outputFile": "pysolfc-release.apk"
}
],
Expand Down
10 changes: 10 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/102122100.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Android specific:
- Temporary screen orientation lock added. Long tap (5 seconds) to the
playground locks/unlocks (toggle) automatic screen rotation.
- Toolbar: configuration of displayed toolbar buttons added to options menu.
- Toolbar: dynamic updates on Toolbar and Options settings.
- Toolbar buttons for 'new deal' and 'restart' have now a delayed
functionality. This prevents from accidental execution.
Main version:
- consult NEWS.asscidoc or html-src/news.html on
github for more change informations.
10 changes: 0 additions & 10 deletions pysollib/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,16 +430,6 @@ def runGame(self, id_, random=None):
self.toolbar.config(
'shuffle',
self.opt.toolbar_vars['shuffle'] and self.game.canShuffle())
if TOOLKIT == 'kivy':
self.toolbar.config(
'undo',
self.opt.toolbar_vars['undo'] and self.game.canUndo())
self.toolbar.config(
'undo',
self.opt.toolbar_vars['redo'] and self.game.canRedo())
self.toolbar.config(
'autodrop',
self.opt.toolbar_vars['autodrop'] and not self.game.canShuffle()) # noqa
# delete intro progress bar
if self.intro.progress:
self.intro.progress.destroy()
Expand Down
2 changes: 1 addition & 1 deletion pysollib/kivy/LApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from kivy.graphics import Line
from kivy.graphics import Rectangle
from kivy.graphics import Triangle
from kivy.properties import NumericProperty
from kivy.properties import StringProperty
from kivy.uix.actionbar import ActionButton
from kivy.uix.actionbar import ActionPrevious
Expand All @@ -52,7 +53,6 @@
from kivy.uix.treeview import TreeViewLabel
from kivy.uix.widget import Widget
from kivy.utils import platform
from kivy.properties import NumericProperty

from pysollib.kivy.androidperms import requestStoragePerm
from pysollib.kivy.androidrot import AndroidScreenRotation
Expand Down
19 changes: 15 additions & 4 deletions pysollib/kivy/menubar.py
Original file line number Diff line number Diff line change
Expand Up @@ -1112,10 +1112,11 @@ def buildTree(self, tv, node):
# 'Top',
# self.menubar.tkopt.toolbar, 1,
# self.menubar.mOptToolbar)

# self.addRadioNode(tv, rg,
# 'Bottom',
# self.menubar.tkopt.toolbar, 2,
# self.menubar.mOptToolbar)
# _('Bottom'),
# self.menubar.tkopt.toolbar, 2,
# self.menubar.mOptToolbar)

self.addRadioNode(tv, rg,
_('Left'),
Expand All @@ -1126,6 +1127,17 @@ def buildTree(self, tv, node):
self.menubar.tkopt.toolbar, 4,
self.menubar.mOptToolbar)

rg1 = tv.add_node(
LTreeNode(text=_('Buttons:')), rg)
if rg1:
for w in TOOLBAR_BUTTONS:
ww = w
ww[0].upper()
self.addCheckNode(tv, rg,
_(ww), # noqa
self.menubar.tkopt.toolbar_vars[w],
self.make_vars_command(self.menubar.mOptToolbarConfig, w)) # noqa

# -------------------------------------------
# Statusbar - not implemented

Expand Down Expand Up @@ -2441,7 +2453,6 @@ def toolbarConfig(self, w, v):
if self._cancelDrag(break_pause=False):
return
self.app.opt.toolbar_vars[w] = v
self.app.toolbar.config(w, v)
self.top.update_idletasks()

#
Expand Down
13 changes: 7 additions & 6 deletions pysollib/kivy/tkconst.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,19 @@
TOOLBAR_BUTTONS = (
"new",
"restart",
"open",
"save",
# "open",
# "save",
"undo",
"redo",
"autodrop",
"shuffle",
"hint",
"pause",
"statistics",
# "statistics",
"rules",
"quit",
"player",
)
# "quit",
# "player",
)

STATUSBAR_ITEMS = (
('stuck', "'You Are Stuck' indicator"),
Expand Down
12 changes: 8 additions & 4 deletions pysollib/kivy/toast.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ def __init__(self, **kw):

self.duration = 4.0
self.tsize = self.size
self.rsize = 20
self.rsize = [20,]
with self.canvas.before:
Color(0.2, 0.2, 0.2, 0.8)
self.rect = RoundedRectangle()
self.bind(size=self._update_rect)
self.bind(texture_size=self.eval_size)

def eval_size(self,instance,size):
width, height = size
Expand All @@ -33,14 +32,17 @@ def eval_size(self,instance,size):
ads = height * 1.7
self.tsize = (width + ads, height + ads)
self.rsize = [(ads+height)/2.0,]
#print(self.tsize,self.rsize)
# print(self.tsize, self.rsize)

def _update_rect(self, instance, value):
self.rect.size = self.tsize
self.rect.pos = (instance.center_x-self.tsize[0]/2.0,instance.center_y-self.tsize[1]/2.0)
# print(self.top)
# print(self.pos_hint)
self.rect.pos = (self.center_x-self.tsize[0]/2.0,self.center_y-self.tsize[1]/2.0)
self.rect.radius = self.rsize

def stop(self, *args):
self.unbind(texture_size=self.eval_size)
self.parent.remove_widget(self)

def hide(self, *args):
Expand All @@ -54,6 +56,7 @@ def show(self, parent=None, duration=2.0):
return
self.duration = duration
parent.add_widget(self)
self.bind(texture_size=self.eval_size)
anim = Animation(opacity=1, duration=0.4)
anim.start(self)
Clock.schedule_once(self.hide,self.duration)
Expand All @@ -64,5 +67,6 @@ def start(self,parent=None):
return
self.opacity = 1
parent.add_widget(self)
self.bind(texture_size=self.eval_size)

# ================================================================
Loading

0 comments on commit ae9aa78

Please sign in to comment.