Coder Social home page Coder Social logo

Can't import about compose-samples HOT 8 CLOSED

android avatar android commented on July 23, 2024
Can't import

from compose-samples.

Comments (8)

AndroidDeveloperLB avatar AndroidDeveloperLB commented on July 23, 2024 1

I see. I should start learning about it soon, then.

from compose-samples.

nickbutcher avatar nickbutcher commented on July 23, 2024

It looks like you've imported the root folder—try importing from the Jetnews folder.

from compose-samples.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on July 23, 2024

Indeed. Usually projects have the root as the one to import.
Now I tried and it works, but something is weird:
Pressing the back key doesn't go back. It just closes, and even if I press the "up" button, it reloads the main screen. In fact it happens even on orientation change.
See:

device-2020-05-19-191838.zip

I've also noticed that there is a navigation drawer, yet it was hard to notice because there is no "hamburger" icon. The navigation drawer forgets its state upon orientation change, and when choosing "interest" it has tabs but no viewPager to swipe between them.

I guess it's more about Compose than how to handle apps nicely, but still... Seems you've put a lot of effort on other various things, and the purpose of Compose is mainly about UI.

from compose-samples.

nickbutcher avatar nickbutcher commented on July 23, 2024

This repo is intended to be a collection of samples; there's only one, Jetnews, right now but we plan to expand it.

Thanks for highlighting those issues. We are aware and working on providing advice on navigation (integrating with the system back button), configuration changes etc. Compose is still pre-alpha so not all parts are there yet.

Re the hamburger menu, this is the design, will feedback to our designer.

from compose-samples.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on July 23, 2024

I see. I was actually quite overwhelmed by the amount of things there that I'm not familiar with.
So much that I thought it's available for a long time that people use it.
Are there any apps that use it already?
What is your suggestion about an already existing app? Especially one that doesn't even use navigation component yet (too huge and too little time for that).

from compose-samples.

nickbutcher avatar nickbutcher commented on July 23, 2024

Yes, a new UI Toolkit is a large undertaking. We'll be updating our documentation, samples, codelabs etc to help you learn but need to balance this against product stability.

I can't comment on current adoption or future plans but it is a goal for Compose to work well with other Jetpack libraries so adopting those would be a good step.

from compose-samples.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on July 23, 2024

Would it replace the current development on Android? Eventually, nobody will use XML anymore for layouts (and maybe drawable?) ?
Is it already possible to implement everything using Compose?
Would it mean there won't be any more android-x support libraries, etc?

I actually kinda liked using XML. Got used to it quite quickly...
And I liked the division between it and normal code.

from compose-samples.

RyanSimon avatar RyanSimon commented on July 23, 2024

Would it replace the current development on Android? Eventually, nobody will use XML anymore for layouts (and maybe drawable?) ?
Is it already possible to implement everything using Compose?
Would it mean there won't be any more android-x support libraries, etc?

I actually kinda liked using XML. Got used to it quite quickly...
And I liked the division between it and normal code.

I'm not a maintainer for Jetpack Compose, but having been an Android Engineer for quite some time, everything you mentioned about XML layouts is actually seen as a downside.

It's a bit out of the scope of my comment, but do a little research on declarative UI like Compose, React JS, and Swift UI. You'll find that there's a load of great reasons for Android to move in this direction.

As for answering your questions. I do believe we will continue to see people use XML and the old View based UI for some time. If only because legacy codebases will call for it, and Compose is compatible with the old way.

Arguably though, Compose is targeted at removing the need to do XML or View class based UI. So in the not so distant future, new apps would prefer starting with Compose, and never touch the old UI framework.

from compose-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.