Coder Social home page Coder Social logo

Comments (21)

chrisjenx avatar chrisjenx commented on August 30, 2024

Your going to need to provide more info than that... I am using ABS + ListViews + Crouton fine.

You mean forever after the crouton has displayed? or just while it is showing?

from crouton.

keyboardsurfer avatar keyboardsurfer commented on August 30, 2024

Both would be a problem that should be treated. But we'll need to figure out what causes this issue.
@aatpocope can you provide some sample code to verify and probably debug it?

from crouton.

aat-antoine avatar aat-antoine commented on August 30, 2024

@chrisjenx
What can I add ? Yes, when i display a Crouton, i can't click on item. Forever.

@keyboardsurfer
Okay ! I will do test for my part and i'll post a reply with some code but i think if we have an activity which extends SherlockListActivity we can reproduce this problem.
I can't do it now because i'm working.

from crouton.

chrisjenx avatar chrisjenx commented on August 30, 2024

Can you also let us know the device and os version?
On 13 Nov 2012 08:34, "aatpocope" [email protected] wrote:

@chrisjenx https://github.com/chrisjenx
What can I add ? Yes, when i display a Crouton, i can't click on item.
Forever.

@keyboardsurfer https://github.com/keyboardsurfer
Okay ! I will do test for my part and i'll post a reply with some code but
i think if we have an activity which extends SherlockListActivity we can
reproduce this problem.
I can't do it now because i'm working.


Reply to this email directly or view it on GitHubhttps://github.com//issues/51#issuecomment-10319041.

from crouton.

aat-antoine avatar aat-antoine commented on August 30, 2024

Samsung Galaxy S II GT-I9100 with ICS 4.0.4

from crouton.

aat-antoine avatar aat-antoine commented on August 30, 2024

Okay !

For example i have a problem with this code :

public class MainActivity extends SherlockListActivity {

private CountryAdapter adapter;
private List<String> countries;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    countries = new ArrayList<String>();
    adapter = new CountryAdapter();
    getListView().setOnItemClickListener(adapter);
    setListAdapter(adapter);
    // Problem with ICS 4.0.4 when you enable the next line
    // Crouton.makeText(MainActivity.this, "This is a Crouton", Style.ALERT).show();
    countries.add("France");
    countries.add("USA");
    countries.add("New-Zealand");
}

private class CountryAdapter extends ArrayAdapter<String> implements OnItemClickListener {

    public CountryAdapter() {
        super(MainActivity.this, android.R.layout.simple_list_item_1);
    }

    @Override
    public int getCount() {
        return countries.size();
    }

    @Override
    public String getItem(int position) {
        return countries.get(position);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        convertView = super.getView(position, convertView, parent);
        TextView tv = (TextView) convertView.findViewById(android.R.id.text1);
        tv.setText(countries.get(position));
        return convertView;
    }

    @Override
    public void onItemClick(AdapterView<?> arg0, View arg1, int position, long id) {
        Intent intent = new Intent(MainActivity.this, DetailActivity.class);
        intent.putExtra(Constants.EXTRA_COUNTRY, countries.get(position));
        startActivity(intent);
    }

}

}

And the activity which we must launch when we click on item :

public class DetailActivity extends SherlockActivity {

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.detail);
    TextView tv = (TextView) findViewById(R.id.description);
    tv.setText(getIntent().getStringExtra(Constants.EXTRA_COUNTRY));
}

}

from crouton.

JJSarrasin avatar JJSarrasin commented on August 30, 2024

Same problem here on Galaxy Nexus 4.2.0 and Samsung Galaxy S3 4.1.1

from crouton.

chrisjenx avatar chrisjenx commented on August 30, 2024

Interesting, I don't think its device related?

Are all you guys using the ListView Activity or have list views in your
Layouts?

I.e. Can you paste some code for us to test?

On 15 November 2012 09:31, Hrl [email protected] wrote:

Same problem here on Galaxy Nexus 4.2.0 and Samsung Galaxy S3 4.1.1


Reply to this email directly or view it on GitHubhttps://github.com//issues/51#issuecomment-10402255.

from crouton.

JJSarrasin avatar JJSarrasin commented on August 30, 2024

Here is the simplest I can have from my case:

Activity:

public class DistanceActivity extends SherlockListActivity  {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_distance);

        //If the following line is commented, it works
        Crouton.showText(this, "TEST", Style.ALERT);

            String[] distances = getResources().getStringArray(R.array.distance_precision_array);
            setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, distances));

            getListView().setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Crouton.showText(DistanceActivity.this, "OK", Style.CONFIRM);
        }
        });
    }
}

Layout:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <ListView
    android:id="@android:id/list"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="10dp" />
</RelativeLayout>

Any idea for this problem ?

from crouton.

aat-antoine avatar aat-antoine commented on August 30, 2024

ListView Activity (see above) and listview in layout like that :

from crouton.

chrisjenx avatar chrisjenx commented on August 30, 2024

Interesting, seems that it breaks the default ListView implementation and
stops onItemClick events being pushed through. Wonder if it steals the
focus incorrectly.

But I have reproduced the issue at least!

On 15 November 2012 10:43, aatpocope [email protected] wrote:

ListView Activity (see above) and listview in layout like that :

android:id="@android https://github.com/android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />


Reply to this email directly or view it on GitHubhttps://github.com//issues/51#issuecomment-10404373.

from crouton.

keyboardsurfer avatar keyboardsurfer commented on August 30, 2024

Thanks for reporting and verifying. I'll have a look and will try to find a solution when I'll finally find the time to take care again.

from crouton.

keyboardsurfer avatar keyboardsurfer commented on August 30, 2024

Just a quick shot: Are you aware of the issue #24 and the workaround I raised there?

from crouton.

chrisjenx avatar chrisjenx commented on August 30, 2024

Does this fix it, the issue that I tested was either the queue stops being processed or that the onClick event stops firing the crouton event. Seen as I have used list views and croutons before, im wondering if it is the queue being unprocessed. I will look at fixing this! Just mental busy :)

from crouton.

keyboardsurfer avatar keyboardsurfer commented on August 30, 2024

I haven't checked the onClick but the queue should fire again after including my workaround.

No hard feelings I'm pretty busy myself.

from crouton.

keyboardsurfer avatar keyboardsurfer commented on August 30, 2024

@hrl can you provide your sample project? I currently don't have the time to create one myself at the moment.

from crouton.

JJSarrasin avatar JJSarrasin commented on August 30, 2024

Hello @keyboardsurfer, I'm kind of busy until the end of the year (some urgent project coming to a deadline). The code above is sufficient to reproduce the bug. I'll do a sample project in 2 or 3 weeks if you couldn't reproduce it until then.

from crouton.

chrisjenx avatar chrisjenx commented on August 30, 2024

I can reproduce it I'll upload my sample project for you.
On 12 Dec 2012 18:43, "Hrl" [email protected] wrote:

Hello @keyboardsurfer https://github.com/keyboardsurfer, I'm kind of
busy until the end of the year (some urgent project coming to a deadline).
The code above is sufficient to reproduce the bug. I'll do a sample project
in 2 or 3 weeks if you couldn't reproduce it until then.


Reply to this email directly or view it on GitHubhttps://github.com//issues/51#issuecomment-11302223.

from crouton.

keyboardsurfer avatar keyboardsurfer commented on August 30, 2024

Thanks a lot. :-)

from crouton.

Leeeeeeelo avatar Leeeeeeelo commented on August 30, 2024

Same issue on Samsung Galaxy S3 4.1.2

from crouton.

keyboardsurfer avatar keyboardsurfer commented on August 30, 2024

Works fine with a ListFragment as well as a SherlockListFragment.

from crouton.

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.