Re: Swithc the Text right or left

81 views
Skip to first unread message
Message has been deleted

SteveJG

unread,
Sep 17, 2019, 9:34:01 AM9/17/19
to mitappinv...@googlegroups.com
Do you mean scroll  the text by "how to switch Text right or left".   You can scroll text either by placing the text in a Label and placing the Label in a Horizontal Scroll Arrangement  and limit the Width of the Label to a percentage of the screen.   You can justify the Text  to Left  Center  Right  in a Label by setting the TextAlignment of the Label  (0 for Left, 1 for Center, 2 for Right justification).

ScrollText.PNG




or something else?

Regards,
Steve


scrollTextLeftRight.aia
Message has been deleted

SteveJG

unread,
Sep 17, 2019, 11:30:50 AM9/17/19
to MIT App Inventor Forum
What you want to do is change the Text in a Label using a set of files.   Perhaps this will help https://groups.google.com/forum/#!topic/mitappinventortest/0ECpp3khHss/discussion 

It shows ways of making an eBook using Text files and using html files.  I don't understand why you might "need to put every chapter in one .csv.  However, if you do that, then convert your csv into a List of Lists and use a LIstView  or ListPicker to select the chapter you want.

Here are some code snippets that illustrate the principles

chaptersfromCSV.PNG




How you put them together depends on what you actually want to do.  The idea is you convert the csv to a List of long pieces of Text, then select the chapters by selecting the Chapter names.  Populate the ListView with the chapter 'names' ; not  the List made from the csv.


A csv uses a comma as a separator.  If your chapter text uses commas, you must adjust your code to use a different delimiter.

Experiment and let us know if these ideas help.

Regards,
Steve
Message has been deleted

Juan Antonio

unread,
Sep 17, 2019, 3:09:07 PM9/17/19
to MIT App Inventor Forum
Here an example of sliding panels with JavaScript.

Message has been deleted

TimAI2

unread,
Sep 17, 2019, 5:02:39 PM9/17/19
to MIT App Inventor Forum
Here is the basic code for left and right swipe using jquery mobile
You need to use the webviewstring with a counter to update the number of the "page"

<!DOCTYPE html>
 <head>
 <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
      <link rel = "stylesheet" href = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
      <script src = "https://code.jquery.com/jquery-1.11.3.min.js"></script>


<script>
    $(document).on("pagecreate","#page1",function() {
        $("body").on("swipeleft",function(){
        $("span").text("swipeleft!!!");
        });
    });
</script>
 <script>
    $(document).on("pagecreate","#page1",function() {
        $("body").on("swiperight",function() {
        $("span").text("swiperight!!!");
        });
    });
</script>

</head>
   
<body>
    <div data-role = "page" id = "page1">
        
        <div data-role = "header">
        </div>

        <div data-role = "main" class = "ui-content">
            <span style = "color:orange"></span>
        </div>
        
</div>
</body>

</html>


Juan Antonio

unread,
Sep 17, 2019, 5:41:14 PM9/17/19
to MIT App Inventor Forum

TimAI2

unread,
Sep 17, 2019, 5:52:34 PM9/17/19
to MIT App Inventor Forum
:)
Message has been deleted

TimAI2

unread,
Sep 18, 2019, 8:33:22 AM9/18/19
to mitappinv...@googlegroups.com
You need to be setting (and getting) the value of the WebViewString on the app side and the javascript side (in the html)
Message has been deleted

Peter Mathijssen

unread,
Sep 18, 2019, 10:53:00 AM9/18/19
to MIT App Inventor Forum
The folder is not accessible.

Peter Mathijssen

unread,
Sep 18, 2019, 11:48:07 AM9/18/19
to MIT App Inventor Forum
Hi Osama,

It is you again. I can see that in your project file ai_ghanemoh0. 

Why are you doing that? Is this again related to the hours and hours of help you got already from the PowerUsers? It looks the same. You would expect that by now you would have learned a whole lot. 

TimAI2

unread,
Sep 18, 2019, 12:22:54 PM9/18/19
to MIT App Inventor Forum
This topic is now closed to replies

Forum users should not mislead others as to who they are.

You are referred to a previous topic where all the answers needed were given

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages