WT 1.1.14 tutorial positions fix, uxcam settings

This commit is contained in:
bossanyit
2021-05-06 22:44:55 +02:00
parent 3137bc2330
commit cd0687a529
10 changed files with 77 additions and 115 deletions
+1 -16
View File
@@ -12,7 +12,7 @@ part 'tutorial_state.dart';
class TutorialBloc extends Bloc<TutorialEvent, TutorialState> with Logging {
late String tutorialName;
final double mediaHeightBase = 390;
final double mediaHeightBase = 675;
bool isActive = false;
bool canActivate = false;
@@ -78,8 +78,6 @@ class TutorialBloc extends Bloc<TutorialEvent, TutorialState> with Logging {
this.showCheckText = action!.showCheckText == true;
this.parent = action!.parent;
}
calculateHeight();
}
}
@@ -110,17 +108,6 @@ class TutorialBloc extends Bloc<TutorialEvent, TutorialState> with Logging {
return true;
}
void calculateHeight() {
int count = getElementCount('<p>');
count += getElementCount('<br/>');
double lines = (actualText!.length / 32 + count);
if (lines < 5) {
lines = lines + 2;
}
calculatedHeight = lines * 15;
print("Calculated Height: $calculatedHeight length: ${actualText!.length} lines: $lines count: $count");
}
int getElementCount(String elem) {
int pos = 0;
int count = 0;
@@ -180,7 +167,6 @@ class TutorialBloc extends Bloc<TutorialEvent, TutorialState> with Logging {
print("Step: $step");
setNextStepData(step);
print("Menu rebuild $menuBloc");
if (menuBloc != null) {
menuBloc!.add(MenuCreate());
}
@@ -200,7 +186,6 @@ class TutorialBloc extends Bloc<TutorialEvent, TutorialState> with Logging {
isActive = false;
canActivate = false;
ActivityDone? activityDone = ActivityDone.tutorialBasic.searchByString(tutorialName);
print("activity Finished: $activityDone");
if (activityDone != null) {
await Cache().setActivityDonePrefs(activityDone);
}
+2 -3
View File
@@ -192,10 +192,9 @@ Future<void> initFlurry() async {
Smartlook.enableCrashlytics(true);
Smartlook.setEventTrackingMode(EventTrackingMode.FULL_TRACKING); */
FlutterUxcam.optIntoSchematicRecordings();
// FlutterUxcam.optIntoVideoRecording();
FlutterUxcam.startWithKey("wvdstyoml4tiwfd");
}
FlutterUxcam.startWithKey("wvdstyoml4tiwfd");
FlutterUxcam.optIntoSchematicRecordings();
}
class WorkoutTestApp extends StatelessWidget {
+21 -19
View File
@@ -216,25 +216,27 @@ class _ExerciseLogPage extends State<ExerciseLogPage> with Trans, Common {
}
void evaluation(ExerciseRepository exerciseRepository, Exercise exercise) {
if (!Cache().hasPurchased) {
showDialog(
context: context,
builder: (BuildContext context) {
return DialogPremium(
unlocked: Cache().hasPurchased,
unlockRound: 1,
unlockedText: t("Enjoy also this premium fetaure to show all old evaluation data of your successful exercises."),
function: "My Exercise Logs",
onTap: () => {Navigator.of(context).pop()},
onCancel: () => {Navigator.of(context).pop()},
);
});
} else {
LinkedHashMap args = LinkedHashMap();
args['exerciseRepository'] = exerciseRepository;
args['exercise'] = exercise;
args['past'] = true;
Navigator.of(context).pushNamed('evaluationPage', arguments: args);
if (Cache().userLoggedIn != null) {
if (!Cache().hasPurchased) {
showDialog(
context: context,
builder: (BuildContext context) {
return DialogPremium(
unlocked: Cache().hasPurchased,
unlockRound: 1,
unlockedText: t("Enjoy also this premium fetaure to show all old evaluation data of your successful exercises."),
function: "My Exercise Logs",
onTap: () => {Navigator.of(context).pop()},
onCancel: () => {Navigator.of(context).pop()},
);
});
} else {
LinkedHashMap args = LinkedHashMap();
args['exerciseRepository'] = exerciseRepository;
args['exercise'] = exercise;
args['past'] = true;
Navigator.of(context).pushNamed('evaluationPage', arguments: args);
}
}
}
+1 -1
View File
@@ -30,7 +30,7 @@ class _MyDevelopmentMuscleState extends State<MyDevelopmentMusclePage> with Comm
@override
void initState() {
super.initState();
if (!Cache().hasPurchased) {
if (!Cache().hasPurchased && Cache().userLoggedIn != null) {
Timer(
Duration(milliseconds: 2000),
() => {
+32 -55
View File
@@ -99,19 +99,22 @@ class _MyExercisePlanPage extends State<MyExercisePlanPage> with Trans, Logging
image: "asset/image/exercise_plan_suggested.jpg",
left: 2,
onTap: () => {
Track().track(TrackingEvent.my_suggested_plan),
showDialog(
context: context,
builder: (BuildContext context) {
return DialogPremium(
unlocked: Cache().hasPurchased,
unlockRound: 2,
function: "Suggested Training Plan",
unlockedText: null,
onTap: () => {Navigator.of(context).pop()},
onCancel: () => {Navigator.of(context).pop()},
);
})
if (Cache().userLoggedIn != null)
{
Track().track(TrackingEvent.my_suggested_plan),
showDialog(
context: context,
builder: (BuildContext context) {
return DialogPremium(
unlocked: Cache().hasPurchased,
unlockRound: 2,
function: "Suggested Training Plan",
unlockedText: null,
onTap: () => {Navigator.of(context).pop()},
onCancel: () => {Navigator.of(context).pop()},
);
})
}
},
isLocked: true,
),
@@ -128,51 +131,25 @@ class _MyExercisePlanPage extends State<MyExercisePlanPage> with Trans, Logging
image: "asset/image/exercise_plan_stars.jpg",
left: 5,
onTap: () => {
Track().track(TrackingEvent.my_special_plan),
showDialog(
context: context,
builder: (BuildContext context) {
return DialogPremium(
unlocked: Cache().hasPurchased,
unlockRound: 1,
function: "Training Programs",
unlockedText: null,
onTap: () => {Navigator.of(context).pop()},
onCancel: () => {Navigator.of(context).pop()},
);
})
if (Cache().userLoggedIn != null)
{
Track().track(TrackingEvent.my_special_plan),
showDialog(
context: context,
builder: (BuildContext context) {
return DialogPremium(
unlocked: Cache().hasPurchased,
unlockRound: 1,
function: "Training Programs",
unlockedText: null,
onTap: () => {Navigator.of(context).pop()},
onCancel: () => {Navigator.of(context).pop()},
);
})
}
},
isLocked: true,
),
/* ImageButton(
width: imageWidth,
textAlignment: Alignment.topLeft,
text: t("Star's Exercise Plan"),
style: GoogleFonts.robotoMono(
textStyle: TextStyle(
fontSize: 14,
color: Colors.white,
fontWeight: FontWeight.bold,
backgroundColor: Colors.black54.withOpacity(0.4))),
image: "asset/image/exercise_plan_stars.jpg",
left: 5,
onTap: () => {
showDialog(
context: context,
builder: (BuildContext context) {
return DialogPremium(
unlocked: false,
unlockRound: 2,
function: "Star's Exercise Plan",
unlockedText: "",
onTap: () => {Navigator.of(context).pop()},
onCancel: () => {Navigator.of(context).pop()},
);
})
},
isLocked: true,
), */
hiddenPlanWidget(exerciseRepository),
hiddenTrainingWidget(),
]),
+13 -14
View File
@@ -24,43 +24,42 @@ class TutorialWidget with Trans, Logging {
void tip(BuildContext context) {
setContext(context);
if (tooltip != null && tooltip!.isOpen) {
tooltip!.rebuild();
}
var renderBox = context.findRenderObject() as RenderBox;
final overlay = Overlay.of(context)!.context.findRenderObject() as RenderBox?;
var targetGlobalCenter = renderBox.localToGlobal(renderBox.size.center(Offset.zero), ancestor: overlay);
final TutorialBloc bloc = BlocProvider.of<TutorialBloc>(context);
if (tooltip != null && tooltip!.isOpen) {
tooltip!.rebuild();
}
final double mediaSize = MediaQuery.of(context).size.width;
final double mediaHeight = MediaQuery.of(context).size.height;
Rect? area;
if (bloc.action != null) {
area = bloc.action!.showBubble == true
? Rect.fromLTWH(targetGlobalCenter.dx - bloc.action!.bubbleX, targetGlobalCenter.dy - bloc.action!.bubbleY,
bloc.action!.bubbleWidth.toDouble(), bloc.action!.bubbleHeight.toDouble())
? Rect.fromLTWH(mediaSize / 2 - 220, targetGlobalCenter.dy - bloc.action!.bubbleY, bloc.action!.bubbleWidth.toDouble(),
bloc.action!.bubbleHeight.toDouble())
//? Rect.fromLTWH(targetGlobalCenter.dx - 60, targetGlobalCenter.dy + 120, 420, 320)
: null;
}
final double mediaSize = MediaQuery.of(context).size.width;
final double mediaHeight = MediaQuery.of(context).size.width;
final double distortion = mediaHeight / bloc.mediaHeightBase;
double fontSize = 14;
if (mediaSize > 400) {
fontSize = 15;
} else if (mediaSize < 375) {
if (mediaSize > 800) {
fontSize = 16;
} else if (mediaSize < 600) {
fontSize = 13;
}
double calculatedTop = bloc.top! / distortion;
//-((1 - distortion) * 100 * (fontSize));
double calculatedTop = bloc.top != null ? bloc.top! : 20.0;
if (calculatedTop < 0) {
calculatedTop = 10;
}
print("Height: $mediaHeight, distortion: $distortion top: ${bloc.top!} calculated $calculatedTop");
print("Height: $mediaHeight, width: $mediaSize distortion: $distortion top: ${bloc.top!} calculated $calculatedTop");
print("targetCenter X ${targetGlobalCenter.dx}");
tooltip = SuperTooltip(
top: calculatedTop,