android-developers
[Arriba] [Todas las Listas]

Re: [android-developers] Qué es "unidades arbitrarias" en el javadoc pa

To: Android Developers <android-developers@xxxxxxxxxxxxxxxx>
Subject: Re: [android-developers] Qué es "unidades arbitrarias" en el javadoc para computeVerticalScrollOffset?
From: jordan.carlyon@xxxxxxxxxxxx
Date: Thu, 17 Aug 2017 12:09:16 -0700 (PDT)
Cc: romainguy@xxxxxxxxxxx
Delivery-date: Thu, 17 Aug 2017 15:10:02 -0400
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:cc:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=kbJzXeTrIuwqkb4NkIo2w4ViSwU7JCH4yNgBzePS674=; b=OTnZ9qKbAUeHyGEmfWyCzdSr2PwrM9qnQpfmoKaiX0p8XNEXyfo9VKFW8+jnPkhIf7 WAOhezG1mxXIuSNwUpvzvn8MeAUU7l43TVGh0Ht0DglI0Rph5+Y9sjsZ9w5atgGFBp2G oLMD3JjUfj61gkH12xTYVMyNptZfUiKkLQ+4boZzKEfYg1DjHL51Yw0aI32QrdR0wMFv 4l/lPySPK4s5FUamfypiCU7XgUksKM/c53wnBvXgYwOxlE+O1czTT53uAJoJFz/rXW0g UFcczXf9HiAOHPnIQb72hnIq5aJEMRt3XGuvwwO7JuzFQkXauZBbjFptwj4NZ3MCrcLT y2XA==
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dowjones-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=kbJzXeTrIuwqkb4NkIo2w4ViSwU7JCH4yNgBzePS674=; b=CjWXLqK7FyNqoSJOLG5KoJ7Av9JuHxTxCzHlQmQrYP9LFHZVsV+JC7hxKnPtETKXge mYerrpmqtAAbQxBVv1bU92l4/D/SBBvVevIM62hpsXVZFSSqXJ/wWwHzT7br+OrpSXdJ o98w9chgGs04dzoz6RDRcsT8DAzugv/CtsaCHQ3HBgeJnrxwKVYI3R2dwfhksBxcuuWg Q5ixYtBdcwP3Db+CGAA6uuVHY+1cqK1TeCwWkqarXFRc180NRseSujfSLRcVJgGnfq7a Tc1vxViYVblzRJ17JVSCgNkWoIEd7uunPQBcxGW1xA4veVYmOpW6JdJS7MOZsYROHy02 ZH2Q==
Envelope-to: traductor@xxxxxxxxxxx
In-reply-to: <CACtN546KzGF7TP+yCAnqqWigXzriWVSa5QVBYLY-dj6Uq4sm9A@mail.gmail.com>
List-archive: <https://groups.google.com/group/android-developer>
List-help: <https://groups.google.com/support/>, <mailto:android-developers+help@googlegroups.com>
List-id: <android-developers.googlegroups.com>
List-post: <https://groups.google.com/group/android-developers/post>, <mailto:android-developers@googlegroups.com>
List-subscribe: <https://groups.google.com/group/android-developers/subscribe>, <mailto:android-developers+subscribe@googlegroups.com>
List-unsubscribe: <mailto:googlegroups-manage+364598216046+unsubscribe@googlegroups.com>, <https://groups.google.com/group/android-developers/subscribe>
Mailing-list: list android-developers@xxxxxxxxxxxxxxxx; contact android-developers+owners@xxxxxxxxxxxxxxxx
References: <95c9a4dc-c498-4c69-ad7f-3ed113c63403@googlegroups.com> <CACtN546KzGF7TP+yCAnqqWigXzriWVSa5QVBYLY-dj6Uq4sm9A@mail.gmail.com>
Reply-to: android-developers@xxxxxxxxxxxxxxxx
Sender: android-developers@xxxxxxxxxxxxxxxx
Sin medir cada elemento cómo  una lista con elementos que varían en la alzada 
tiene un liso *scroll barra? Parece que si *setSmoothScrollBar es puesto a falso 
entonces el *scrollbar *indicator/saltos de pulgar de elemento a elemento, si puesto a cierto 
entonces el *scrollbar *indicator medida de cambios para emparejar cada elemento. Tampoco 
es un esperado *behavior de un *scrollbar. Qué es la manera mejor de cumplir 
esto? Parece menos que ideal de medir cada elemento.

Veo que *AbsListView 
<*http://*grepcode.*com/Archivo/*repository.*grepcode.*com/*java/*ext/*com.*google.*android/*android/5.1.1_*r1/*android/*widget/*TextView.*java#*TextView.*computeVerticalScrollRange%#28%29> usos 
la medida de lista * 100 puesto que el *scrollRange y entonces  algunos cálculos para 
cada elemento para el *scrollExtent pero esto no aparece para trabajar bien con un 
*recyclerView, los números no parecen a nunca bastante el trabajo y yo no soy seguro 
por qué 100 está siendo utilizado.

En domingo, octubre 7, 2012 en 4:37:18 SOY *UTC-4, *Romain Guy escribió:
>
> *ListView a veces utiliza la unidad "" de elemento (número total de elementos, primer 
> elemento visible, *etc) en vez de *pixels porque puede no siempre saber el 
> exacto *pixel alzada de todos los elementos. Puedes también unidades de uso que vienen de vuestro 
> *dataset (un mapa podría muy bien utilizar *meters para caso, un *graph podría utilizar 
> tiempo o porcentaje.)
>
> Siente libre de utilizar *pixels pero no es *mandatory. Qué asuntos es que todo 3 
> métodos utilizan la misma unidad.
> En *Oct 6, 2012 7:50 AM, "*Raffaele *Sgarro" <raffael...@xxxxxxxxx 
> <*javascript:>> escribió:
>
>> La documentación para *computeVerticalScrollRange() dice 
>> <*http://*developer.*android.*com/Referencia/*android/Vista/de vista.*html#*computeVerticalScrollRange()>
>> :
>>
>>>
>>> Computar la gama vertical que el vertical *scrollbar representa.
>>> La gama es expresada en *unidades arbitrarias* que tienen que ser igual cuando 
>>> las unidades utilizadas por *computeVerticalScrollExtent() 
>>> <*http://*developer.*android.*com/Referencia/*android/Vista/de vista.*html#*computeVerticalScrollExtent()>
>>>  *andcomputeVerticalScrollOffset() 
>>> <*http://*developer.*android.*com/Referencia/*android/Vista/de vista.*html#*computeVerticalScrollOffset()>
>>> .
>>
>>
>> Las mismas *unidades arbitrarias* son mencionadas en los otros dos métodos. 
>> Mirando en las fuentes, esto es lo que encontré:
>>
>>     protegido *int *computeVerticalScrollRange()
>>         #nom *getHeight();
>>     }
>>     protegido *int *computeVerticalScrollOffset()
>>         #nom *mScrollY;
>>     }
>>     protegido *int *computeVerticalScrollExtent()
>>         #nom *getHeight();
>>     }
>>
>> Tan, qué yendo en aquí? *getHeight() Es documentado para regresar la alzada 
>> de la vista en *pixels, y vago si hace cualquier sentido para medir cosas 
>> en millas, kilómetros, *astronomic unidades...  Lo documentaron en 
>> tal manera de dejar *subclasses para utilizar porcentajes o número de elementos?
>>
>> En particular, miraba en estos métodos porque estoy implementando un 
>> *ListView con un fondo de costumbre 
>> <*http://*stackoverflow.*com/*q/12737600/315306>, y parece necesito tratar *scroll dimensiones
>>
>> -- 
>> recibiste este mensaje porque eres *subscribed al *Google
>> Grupos "*Android *Developers" grupo.
>> A correo a este grupo, envía *email a *android-d...@xxxxxxxxxxxxxxxx 
>> <*javascript:>
>> A *unsubscribe de este grupo, envía *email a *android-*developers+unsubscribe@xxxxxxxxxxxxxxxx
>>  <*javascript:>
>> Para más opciones, visita este grupo en
>> *http://grupos.*google.*com/Grupo/*android-*developers?*hl=*en
>
>

-- 
Recibiste este mensaje porque eres *subscribed al *Google Grupos "*Android *Developers" grupo.
A *unsubscribe de este grupo y la parón que recibe *emails de él, enviar un *email a *android-*developers+unsubscribe@xxxxxxxxxxxxxxxx.
A correo a este grupo, envía *email a *android-developers@xxxxxxxxxxxxxxxx.
Visita este grupo en *https://grupos.*google.*com/Grupo/*android-*developers.
Para ver esta discusión en la visita de web *https://grupos.*google.*com/*d/*msgid/*android-*developers/557272#uno4-*c089-4*d57-8*e71-*d6*aaa75*dcd01%40*googlegroups.*com.
Para más opciones, visita *https://grupos.*google.*com/*d/*optout.
Without measuring each item how would a list with items that vary in height 
have a smooth scroll bar? It seems that if setSmoothScrollBar is set to 
false then the scrollbar indicator/thumb jumps from item to item, if set to 
true then the scrollbar indicator changes size to match each item. Neither 
is an expected behavior from a scrollbar. What is the best way to 
accomplish this? It seems less than ideal to measure each item.

I see that AbsListView 
<http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.1.1_r1/android/widget/TextView.java#TextView.computeVerticalScrollRange%28%29> uses 
the list size * 100 for the scrollRange and then does some calculations for 
each item for the scrollExtent but this doesn't appear to work well with a 
recyclerView, the numbers don't seem to ever quite work and I'm not sure 
why 100 is being used.

On Sunday, October 7, 2012 at 4:37:18 AM UTC-4, Romain Guy wrote:
>
> ListView sometimes uses the "item" unit (total number of items, first 
> visible item, etc) instead of pixels because it cannot always know the 
> exact pixel height of all items. You can also use units that come from your 
> dataset (a map could very well use meters for instance, a graph could use 
> time or percentage.)
>
> Feel free to use pixels but it's not mandatory. What matters is that all 3 
> methods use the same unit.
> On Oct 6, 2012 7:50 AM, "Raffaele Sgarro" <raffael...@xxxxxxxxx 
> <javascript:>> wrote:
>
>> The documentation for computeVerticalScrollRange() says 
>> <http://developer.android.com/reference/android/view/View.html#computeVerticalScrollRange()>
>> :
>>
>>>
>>> Compute the vertical range that the vertical scrollbar represents.
>>> The range is expressed in *arbitrary units* that must be the same as 
>>> the units used by computeVerticalScrollExtent() 
>>> <http://developer.android.com/reference/android/view/View.html#computeVerticalScrollExtent()>
>>>  andcomputeVerticalScrollOffset() 
>>> <http://developer.android.com/reference/android/view/View.html#computeVerticalScrollOffset()>
>>> .
>>
>>
>> The same *arbitrary units* are mentioned in the other two methods. 
>> Looking at the sources, this is what I found:
>>
>>     protected int computeVerticalScrollRange() {
>>         return getHeight();
>>     }
>>     protected int computeVerticalScrollOffset() {
>>         return mScrollY;
>>     }
>>     protected int computeVerticalScrollExtent() {
>>         return getHeight();
>>     }
>>
>> So, what's going on here? getHeight() is documented to return the height 
>> of the view in pixels, and I wander if it makes any sense to measure things 
>> in miles, kilometers, astronomic units... Do they documented it in such a 
>> way to allow subclasses to use percentages or number of items?
>>
>> In particular, I looked at this methods because I'm implementing a 
>> ListView with a custom background 
>> <http://stackoverflow.com/q/12737600/315306>, and it seems I need to 
>> deal with scroll dimensions
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-d...@xxxxxxxxxxxxxxxx 
>> <javascript:>
>> To unsubscribe from this group, send email to
>> android-developers+unsubscribe@xxxxxxxxxxxxxxxx <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>

-- 
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to android-developers@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/557272a4-c089-4d57-8e71-d6aaa75dcd01%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Anterior por Tema] Tema Actual [Siguiente por Tema>
  • Re: [android-developers] Qué es "unidades arbitrarias" en el javadoc para computeVerticalScrollOffset?, jordan . carlyon <=