SlideShare ist ein Scribd-Unternehmen logo
1 von 34
Downloaden Sie, um offline zu lesen
Takahiro Yoshimura (@alterakey)
           22.10.2011
Twitter   →@alterakey
https://github.com/taky/effy
…
Effy ZIP
Eclipse

Android SDK

Effy
Eclipse Effy
DrawActivity

                 DA.plot

Paint   Canvas
DrawActivity.java

private void initialSetup()
{
    ...
! this.setPenColor(color);
! this.paint.setStrokeWidth(5.0f);
}


      →
…
res/xml/config.xml:

ConfigActivity:

ConfigKey:
<ListPreference>




  res/values/arrays.xml
res/xml/config.xml

<ListPreference
       android:key="pen_width"
       android:title="         "
      android:defaultValue="5"
      android:entries="@array/entries_pen_width"
      android:entryValues="@array/entry_values_pen_width" />
res/values/arrays.xml (1)

<string-array name="entries_pen_width">
    <item>    </item>
   <item>   </item>
   <item>     </item>
   <item>   </item>
   <item>     </item>
</string-array>
res/values/arrays.xml (2)

<string-array name="entry_values_pen_width">
    <item>2</item>
    <item>3</item>
    <item>5</item>
    <item>8</item>
    <item>13</item>
</string-array>
CK PEN_WIDTH
ConfigKey.java

public class ConfigKey
{
! public static final String DROP_ALPHA = "drop_alpha";
! public static final String PEN_ALPHA = "pen_alpha";

    public static final String PEN_WIDTH = "pen_width";

}
→

private        CA.onCreate

CA.onResume

   CA.updateSummary
ConfigActivity.java (1)

public class ConfigActivity extends PreferenceActivity ...
{
! private ListPreference drop_alpha;
! private ListPreference pen_alpha;

   private ListPreference pen_width;

   @Override
   protected void onCreate(Bundle savedInstanceState) {
ConfigActivity.java (2)

@Override
protected void onCreate(Bundle savedInstanceState) {
    ...
    this.pen_alpha = (ListPreference)getPreferenceScreen
().findPreference(ConfigKey.PEN_ALPHA);

    this.pen_width = (ListPreference)getPreferenceScreen
().findPreference(ConfigKey.PEN_WIDTH);

}
ConfigActivity.java (3)

@Override
protected void onResume() {
   ...
   this.updateSummary(sharedPreferences, ConfigKey.PEN_ALPHA);

    this.updateSummary(sharedPreferences, ConfigKey.PEN_WIDTH);

    ...
}
ConfigActivity.java (4)

private void updateSummary(SharedPreferences ...
{
    ...
    if (key.equals(ConfigKey.PEN_ALPHA))
        this.setSummary(this.pen_alpha, this.pen_alpha.getEntry());

    if (key.equals(ConfigKey.PEN_WIDTH))
       this.setSummary(this.pen_width, this.pen_width.getEntry());

}
…
SharedPreferences
DA.initialSetup → DA.restyle

  SharedPreferences

                     (DROP_ALPHA)
                                    …
DrawActivity.java

private void initialSetup()
{
    ...
    this.paint.setStrokeWidth(5.0f);
}
DrawActivity.java

private void restyle()
{
    ...
    this.setPenColor(this.paint.getColor());

   float pen_width = (float)Integer.parseInt(pref.getString
(ConfigKey.PEN_WIDTH, "5"));
   this.paint.setStrokeWidth(pen_width);

}
…
DA.restyle():
“drop_alpha” → ConfigKey.DROP_ALPHA
Paint   Canvas
github   (GPL-3)
#5
Android 3.1
https://github.com/taky/effy/issues/5

         Activity



                    : 3.2→OK 3.0/3.1→NG
アプリを弄ってみる #1 #antama_ws

Weitere ähnliche Inhalte

Was ist angesagt?

STC 2016 Programming Language Storytime
STC 2016 Programming Language StorytimeSTC 2016 Programming Language Storytime
STC 2016 Programming Language Storytime
Sarah Kiniry
 
Gary Gao: APIs Are Good
Gary Gao: APIs Are GoodGary Gao: APIs Are Good
Gary Gao: APIs Are Good
talnoznisky
 

Was ist angesagt? (20)

PHP MATERIAL
PHP MATERIALPHP MATERIAL
PHP MATERIAL
 
PHP7. Game Changer.
PHP7. Game Changer. PHP7. Game Changer.
PHP7. Game Changer.
 
STC 2016 Programming Language Storytime
STC 2016 Programming Language StorytimeSTC 2016 Programming Language Storytime
STC 2016 Programming Language Storytime
 
PHP 7
PHP 7PHP 7
PHP 7
 
SQL -PHP Tutorial
SQL -PHP TutorialSQL -PHP Tutorial
SQL -PHP Tutorial
 
Arrays &amp; functions in php
Arrays &amp; functions in phpArrays &amp; functions in php
Arrays &amp; functions in php
 
perl course-in-mumbai
 perl course-in-mumbai perl course-in-mumbai
perl course-in-mumbai
 
Code documentation
Code documentationCode documentation
Code documentation
 
EMF Tips n Tricks
EMF Tips n TricksEMF Tips n Tricks
EMF Tips n Tricks
 
Zend Certification Preparation Tutorial
Zend Certification Preparation TutorialZend Certification Preparation Tutorial
Zend Certification Preparation Tutorial
 
Simplifying java with lambdas (short)
Simplifying java with lambdas (short)Simplifying java with lambdas (short)
Simplifying java with lambdas (short)
 
Php unit the-mostunknownparts
Php unit the-mostunknownpartsPhp unit the-mostunknownparts
Php unit the-mostunknownparts
 
PHP Traits
PHP TraitsPHP Traits
PHP Traits
 
Clean Code: Chapter 3 Function
Clean Code: Chapter 3 FunctionClean Code: Chapter 3 Function
Clean Code: Chapter 3 Function
 
Codegeneration With Xtend
Codegeneration With XtendCodegeneration With Xtend
Codegeneration With Xtend
 
Gary Gao: APIs Are Good
Gary Gao: APIs Are GoodGary Gao: APIs Are Good
Gary Gao: APIs Are Good
 
PerlTesting
PerlTestingPerlTesting
PerlTesting
 
PerlScripting
PerlScriptingPerlScripting
PerlScripting
 
Fewd week5 slides
Fewd week5 slidesFewd week5 slides
Fewd week5 slides
 
Python decorators
Python decoratorsPython decorators
Python decorators
 

Ähnlich wie アプリを弄ってみる #1 #antama_ws

Intro to scala
Intro to scalaIntro to scala
Intro to scala
Joe Zulli
 
Soundreader.classpathSoundreader.project Soundre.docx
Soundreader.classpathSoundreader.project  Soundre.docxSoundreader.classpathSoundreader.project  Soundre.docx
Soundreader.classpathSoundreader.project Soundre.docx
whitneyleman54422
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
Alexey Buzdin
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
C.T.Co
 

Ähnlich wie アプリを弄ってみる #1 #antama_ws (20)

Ast transformations
Ast transformationsAst transformations
Ast transformations
 
Scaladroids: Developing Android Apps with Scala
Scaladroids: Developing Android Apps with ScalaScaladroids: Developing Android Apps with Scala
Scaladroids: Developing Android Apps with Scala
 
Ruby tricks2
Ruby tricks2Ruby tricks2
Ruby tricks2
 
Intro to scala
Intro to scalaIntro to scala
Intro to scala
 
PHP: GraphQL consistency through code generation
PHP: GraphQL consistency through code generationPHP: GraphQL consistency through code generation
PHP: GraphQL consistency through code generation
 
Soundreader.classpathSoundreader.project Soundre.docx
Soundreader.classpathSoundreader.project  Soundre.docxSoundreader.classpathSoundreader.project  Soundre.docx
Soundreader.classpathSoundreader.project Soundre.docx
 
Code generation for alternative languages
Code generation for alternative languagesCode generation for alternative languages
Code generation for alternative languages
 
Scala - en bedre og mere effektiv Java?
Scala - en bedre og mere effektiv Java?Scala - en bedre og mere effektiv Java?
Scala - en bedre og mere effektiv Java?
 
OOP in PHP
OOP in PHPOOP in PHP
OOP in PHP
 
Solid principles
Solid principlesSolid principles
Solid principles
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
Taming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, MacoscopeTaming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, Macoscope
 
Java
JavaJava
Java
 
All I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web FrameworkAll I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web Framework
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
2014 holden - databricks umd scala crash course
2014   holden - databricks umd scala crash course2014   holden - databricks umd scala crash course
2014 holden - databricks umd scala crash course
 
So various polymorphism in Scala
So various polymorphism in ScalaSo various polymorphism in Scala
So various polymorphism in Scala
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
 
PhpUnit - The most unknown Parts
PhpUnit - The most unknown PartsPhpUnit - The most unknown Parts
PhpUnit - The most unknown Parts
 

Mehr von Takahiro Yoshimura

Mehr von Takahiro Yoshimura (20)

Looking Back 2023
Looking Back 2023Looking Back 2023
Looking Back 2023
 
Fill In The Blank
Fill In The BlankFill In The Blank
Fill In The Blank
 
Ticket To The Dark World
Ticket To The Dark WorldTicket To The Dark World
Ticket To The Dark World
 
Looking back 2022
Looking back 2022Looking back 2022
Looking back 2022
 
Hazy Datagrams
Hazy DatagramsHazy Datagrams
Hazy Datagrams
 
Wartime Pigeons
Wartime PigeonsWartime Pigeons
Wartime Pigeons
 
Securing Supply Chains
Securing Supply ChainsSecuring Supply Chains
Securing Supply Chains
 
Looking Back: CIS on Managed K8S
Looking Back: CIS on Managed K8SLooking Back: CIS on Managed K8S
Looking Back: CIS on Managed K8S
 
Beijing Report 2022
Beijing Report 2022Beijing Report 2022
Beijing Report 2022
 
Asynchronicity
AsynchronicityAsynchronicity
Asynchronicity
 
Outsmarting Smartphone Apps 2
Outsmarting Smartphone Apps 2Outsmarting Smartphone Apps 2
Outsmarting Smartphone Apps 2
 
Outsmarting Smartphone Apps 2
Outsmarting Smartphone Apps 2Outsmarting Smartphone Apps 2
Outsmarting Smartphone Apps 2
 
Outsmarting Smartphone Apps
Outsmarting Smartphone AppsOutsmarting Smartphone Apps
Outsmarting Smartphone Apps
 
Drawing Dataflow On Dalvik Bytecodes
Drawing Dataflow On Dalvik Bytecodes Drawing Dataflow On Dalvik Bytecodes
Drawing Dataflow On Dalvik Bytecodes
 
Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes
Trueseeing: Effective Dataflow Analysis over Dalvik OpcodesTrueseeing: Effective Dataflow Analysis over Dalvik Opcodes
Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes
 
10 (about make 10 with 4 numbers challenge)
10 (about make 10 with 4 numbers challenge)10 (about make 10 with 4 numbers challenge)
10 (about make 10 with 4 numbers challenge)
 
Go goes Mobile: Quick Exploration on Go 1.5 and Gomobile
Go goes Mobile: Quick Exploration on Go 1.5 and GomobileGo goes Mobile: Quick Exploration on Go 1.5 and Gomobile
Go goes Mobile: Quick Exploration on Go 1.5 and Gomobile
 
Android Wear: Good Parts
Android Wear: Good PartsAndroid Wear: Good Parts
Android Wear: Good Parts
 
DEFCON21×S2 REPORT
DEFCON21×S2 REPORTDEFCON21×S2 REPORT
DEFCON21×S2 REPORT
 
伝授の巻について #スクエアフリーセミナー #yochiand
伝授の巻について #スクエアフリーセミナー #yochiand伝授の巻について #スクエアフリーセミナー #yochiand
伝授の巻について #スクエアフリーセミナー #yochiand
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

アプリを弄ってみる #1 #antama_ws